FAQ Database Discussion Community

Get UIImageView CGPoints

i want to get all the points in my UIImageVeiw , so i can change "some" points colors without the need of UITouch .. is it possible? What i am thinking about is: get all points in uiimageview get color of each point. if the previous color= some specific color,...

Failed to use CGPoint, the struct, in Swift

My Situation: I have learnt Swift for a while and Swift is my only language I've learnt for iOS Development, which means I did not learn Objective-C Systematically. I can just read OC Code a little. I got a CGPoint problem when I tried to translate a OC project to...

store Array containing CGPoints in CoreData database (Swift)

so as the title already states I'm trying to save an array to the database. If this is possible, how do I do it? If not I hope you can help me with some other solution. I am making an iOS app where if the user touches (and moves) the...

How to delete a drawn CGPoint on a UIImageView

I have a UIImageView that i draw on it points . I store my CGpoint in an NSArray with a capacity of 100. Every time i receive a new CGpoint i want to erase the last object from the array , remove it from the array and then draw the...

How to compare two points in Swift

I have a UITextView which contains text and images. I also have a CGPoint array containing coordinates of images added by a user in the UITextFied. Whenever texts in the UITextView changes (addition or deletion), I get the position of the cursor which is a CGPoint object. Now I want...

How to calculate number of black colored CGPoint in a view

I have some difficulties in Swift, Xcode I have drawn UIView which has transparent background and I need to calculate the percentage of drawn area in UIView, any ideas? I only know the way by reviewing each cgpoint and getting the value of alpha

Get CGPoint x points in front of node

I am working on a game in sprite kit and have been trying to get a point in front of a node. I've been reading up on trigonometry but have not been able to do it. The problem: Get a CGPoint x units in front of an SKSpriteNode, relative to...

How can I create a UIView at a certain CGPoint?

I need to be able to create and display a UIView at a a certain CGPoint. So far I have a gesture recogniser that is added as a subview to the main view. I then create a UIView programatically and set's it's x and y coordinates to the CGPoint that...

iOS: convert CGPoint in screen coordinates to CATransform3D in iCarousel?

I wanted to add a possibility to drag elements inside the carousel and I have some troubles with positioning and transformations of a draggable element. As I understand it is better to temporarily hide/delete the draggable element and create its proxy outside the carousel item array which represents the position...

How can i set Frame properly After dragging?

I am Building iOS App Using StoryBoards. In My App, I want to create a custom slider. For that I created two views and image programmatically. Big View is considered as slider. And small one means the thumb.I applied panGesture for the thumb so that it can be moveable. It...

Shortest distance from CGPoint to segment

I've been trying to implement Douglas-Peucker algorithm into my code and I'm able to translate pseudocode into Swift, except for the shortestDistanceToSegment function. Only Swift version I could find was answered here but I don't understand what that actually does. I need a function that gets three points as arguments...