Questions tagged [cgpoint]

CGPoint is a structure from Apple's Core Graphics framework. It is used to represent a point in two dimensions.

CGPoint is a C struct that contains information about the location of a point in two dimensions.

Fields:

  • x: The X location of the point
  • y: The Y location of the point
509 questions
0
votes
1 answer

Only set CGPoint of the frame

I have a problem that hopefully has a simple solution. I am trying to create a bobbing effect using a button, a timer, frame, cgaffinetransformrotations, and delays. Everything would be great, except that when the button is rotated and I set the…
Liftoff
  • 24,717
  • 13
  • 66
  • 119
0
votes
2 answers

CGPoint Local To Global Issue

I am stuck at a Local to Global Point issue in Objective C ViewController base Application I have one ScrollView as a SubView of the ViewController which has Around 13 to 15 UIButtons as a SubView at a Time there are only 3 UIButton which are in the…
0
votes
1 answer

Passing a CGPoint to another method ends with (inf, inf)

When trying to pass a CGPoint to a method the point is passed, but once inside the called method the CGPoint values show (inf, inf)? So passing the location CGPoint to the createShapeAt method ends in code not working. Maybe I am not implementing…
jdog
  • 10,351
  • 29
  • 90
  • 165
-1
votes
1 answer

how to undo last draw stroke in imageContext

I want my swift code to undo the last drawn stroke. I have seen something like the use of PopLast() but connecting that with image view pic does not work. To do the drawing I am using GetImageContext. Which i know has less options with drawing. But…
joe buck
  • 31
  • 1
  • 7
-1
votes
1 answer

Convert JSON array of numbers into CGPoints in Objective-C or Swift

I am trying to convert JSON from an API into an array of cgpoints that I can use in core graphics. The JSON looks…
user6631314
  • 1,751
  • 1
  • 13
  • 44
-1
votes
2 answers

create center anchor point of object

My swift code below is trying to rotate a imageview around another imageview. I want the rotation to work just like a game spinner. A link to something close to what I am looking for is…
user13245026
-1
votes
1 answer

CGPointMake(random(), random()) not working

Possible Duplicate: Generating Random Numbers in Objective-C Hi I am creating an app where when you press a pimple it travels to a random place in the view. THe pimple is a UIImageView. Here is the code that I put in: -(void)touchesBegan:(NSSet…
user722566
  • 203
  • 1
  • 5
  • 16
-1
votes
1 answer

How to add curved view top left cornor in swift

How to add uiview to top-left corner with curves. I have done somethings like this class curvedView: UIView { override func draw(_ rect: CGRect) { let color = UIColor.blue let y:CGFloat = 0 let myBezier = UIBezierPath() …
-1
votes
2 answers

Check Location Of UIImageView

I need to make a condition check for if one of my imageView's ends up off the screen. In other words I was hoping someone could help me set up an if statement to see where my imageView is on the screen if previewImageView......... (something…
benjamin852
  • 509
  • 7
  • 19
-1
votes
1 answer

How to Find the nearest CGPoint and make a cluster from NSArray?

I have one scenario as do cluster for the nearest CGPoint in UIView. So i have set of CGPoint NSArray, I trying to get the nearest value and do cluster but i could not get the logic : // my code for (CGPoint firstObjOfCGPoint in cgPointGroupArray)…
-1
votes
1 answer

Swift: How to convert CGPoints from SpriteKit to CGRect?

In SpriteKit, I can use touch locatons to record "Hits" in a target, where center of the target, "bulls eye" have the coordinates (0,0). After plenty of shooting, I will fetch all hits as an array with CGPoints. Since the target is 500 x 500 points…
Tom Tallak Solbu
  • 559
  • 6
  • 20
-1
votes
1 answer

Finding longPress release Location

I'm Using LongPress on control and drag different positions in views. I found out the starting position using UIGestureRecognizerStateBegan. how do i found out the UIGestureRecognizerStateChanged position?
-1
votes
1 answer

Best choice when detecting whether a view's point is inside another view?

So I've found 3 ways to make this happen. convertPoint:toView: convertPoint:fromView: convertRect:toView: convertRect:fromView: Bool CGRectContainsPoint(CGRect rect, CGPoint point); BOOL isPointInsideView = [aView pointInside:aPoint…
durazno
  • 559
  • 2
  • 7
  • 25
-1
votes
3 answers

Array of CGPoint

http://code.tutsplus.com/tutorials/ios-sdk-advanced-freehand-drawing-techniques--mobile-15602 In this tutorial I found a line that made me wonder CGPoint pointsBuffer[CAPACITY]; where CAPACITY is #define CAPACITY 100 I tried to NSLog…
jane
  • 309
  • 2
  • 11
-1
votes
1 answer

UIView follows path while dragging

I want UIView to follows path AB while user dragging it. For each CD I need to calculate y. How to calculate P(x,y) and h?
Bojan
  • 147
  • 2
  • 8
1 2 3
33
34