Shai UI
Shai UI

Reputation: 51978

iPhone: How to get top left corner coordinate of a UIView?

I just want to get the x,y coordinate of the top left corner of a view, how might I do this? Thanks!

Upvotes: 9

Views: 3708

Answers (2)

user
user

Reputation: 1

this is bottom left ---> CGPoint topLeft = theView.frame.origin;

top left is:

CGPoint topLeft = theView.frame.origin+theView.frame.height;

Upvotes: -1

Jonathan Grynspan
Jonathan Grynspan

Reputation: 43472

CGPoint topLeft = theView.frame.origin;

Upvotes: 13

Related Questions