IOS-UIView Coordinate System Conversion-convertRect toview
Coordinate Transformation in iOS -- UIView // convert the pixel point from the view where the point is located to the target view, and return the pixel value-(CGPoint) convertPoint (CGPoint) in the target view) point toView :( UIView *) view; // transfers the pixel point from the view to the current view, and returns the pixel value-(CGPoint) convertPoint :( CGPoint) in the current view) point fromView :( UIView *) view; // convert the rect view from the rect view to the target view, and return the rect-(CGRect) convertRect (CGRect) in the target view) rect toView :( UIView *) view; // switch rect from view to current view, return rect-(CGRect) convertRect :( CGRect) rect fromView :( UIView *) in current view *) view; for example, convert the frame of subview (btn) in UITableViewCell to controllerA. // There Is A UITableView in controllerA, and there are multiple UITableVieCell lines in UITableView, put a button on the cell // implement 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 CGRect rc = [btn when btn is known. superview convertRect: btn. frame toView: self. view]; or CGRect rc = [self. view convertRect: btn. frame fromView: btn. superview];