jean mayot
jean mayot

Reputation: 29

how can we use the coordinates of an image

I'm on xcode And I have an image that is created everytime we open the application, I want to use its coordinates to calculate some stuff. But I don't know how can I use them, I think that it is something like

CGPoint(x;y) 

or

int x = (x of the image) 

and

int y= (y of theimage). 

How can i do this please ?

Upvotes: 0

Views: 933

Answers (1)

hundreth
hundreth

Reputation: 841

To get the origin of a UIImageView, just use:

int x = imageView.frame.origin.x;
int y = imageView.frame.origin.y;

Or:

CGPoint origin = imageView.frame.origin;

Upvotes: 1

Related Questions