Converts pixel point from view to target view, returns the pixel value in the target view-(Cgpoint) Convertpoint: (cgpoint) point toview: (UIView *) view;// Converts 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-(CGRect) Convertrect: (cgrect) rect toview: (UIView *) view;//in the target view Converts a rect from view to the current view, returning rect-(CGRect) Convertrect in the current View: (CGRect) rect fromview: (UIView *) view; Example to convert a frame of subview (BTN) in UITableViewCell to Controllera//Controllera with a uitableview, There are multiple lines in the UITableView Uitableviecell,cell a button//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 transformations in the UIView