Consider a screen point (CGPoint) and a view (UIView), which is somewhere inside the view hierarchy (it can be a subview of other views).
How can you convert the point to a point relative to the view's coordinates?
Consider a screen point (CGPoint) and a view (UIView), which is somewhere inside the view hierarchy (it can be a subview of other views).
How can you convert the point to a point relative to the view's coordinates?
First, convert the point from screen coordinates to the coordinates of your main window:
Second, convert the point from window coords to view coords: