[OBJC]View plain Copy//convert pixel point from view to Target view, return the pixel value in the view of the target views-(Cgpoint) Convertpoint: (cgpoint) point Toview: (UIV Iew *) view; Converts the pixel point from view to the current view, returning the pixel value in the current View-(Cgpoint) Convertpoint: (cgpoint) point fromview: (UIView *) view; Converts the rect from the Rect view to the target view, returning rect-(CGRect) Convertrect: (cgrect) rect toview: (UIView *) view in the target view; Converts rect from view to the current view, returning Rect-(CGRect) Convertrect in the current View: (CGRect) rect fromview: (UIView *) view;
The example converts the frame of Subview (BTN) in UITableViewCell to Controllera
[OBJC] View plain copy // controllera has a uitableview, There are multiple lines in the UITableView Uitableviecell,cell with a button // Controllera: = [cell convertRect:cell.btn.frame toView:self.view]; or CGRect rc = [self.view convertRect:cell.btn.frame fromView:cell]; // This RC is btn in Controllera rect 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];