Search code examples
ioscocoa-touchios6

how to get coordinates of button with respect to superview?


My view hierarchy is

UIViewController.view

a subview (on main view with half size and in bottom)

a button on this subview

I want to get the co-ordinates of this button with respect to my main view

the CGRect of this button but according to superview.


Solution

  • [self.view convertRect:button.frame fromView:button.superview];