Converts pixel point from view to target view, returns the pixel value in the target view
-(Cgpoint) Convertpoint: (cgpoint) point toview: (UIView *) view;
Converts a pixel point from view to the current view, returning the pixel value in the current view
-(Cgpoint) Convertpoint: (cgpoint) point fromview: (UIView *) view;
Converts a rect from the view of a rect to the target view, returning the RECT in the target view
-(CGRect) Convertrect: (cgrect) rect toview: (UIView *) view;
Converts a rect from view to the current view, returning a rect in the current view
-(CGRect) Convertrect: (cgrect) rect fromview: (UIView *) view;
Example converts a frame of subview (BTN) in UITableViewCell to Controllera
There is a uitableview in the Controllera, there is a button on Uitableviecell,cell in UITableView.
Implemented in Controllera:
CGRect rc = [cell convertRect:cell.btn.frame ToView:self.view];
Or
CGRect rc = [Self.view convertRect:cell.btn.frame Fromview:cell];
This RC is a rect of btn in Controllera
Or when known btn:
CGRect rc = [Btn.superview convertRect:btn.frame ToView:self.view];
Or
CGRect rc = [Self.view convertRect:btn.frame FromView:btn.superview];
Coordinate transformation in ios--UIView