iOS common coordinates conversion to handle some drop-down box formation of the button position, I have the bottom two to do a personal understanding, the shortcomings of a lot of apologies
-(Cgpoint) Convertpoint: (cgpoint) point Toview: (Nullable UIView *) view;
-(Cgpoint) Convertpoint: (cgpoint) point Fromview: (Nullable UIView *) view;
-(CGRect) Convertrect: (cgrect) Rect toview: (Nullable UIView *) view;
-(CGRect) Convertrect: (cgrect) Rect fromview: (Nullable UIView *) view;
/*
Converts the frame of the current view to the distance from the target view, returning the distance from the real view
RC value = View.fram+rect
*/
View1 is the target view Self.view represents the current view
CGRect rect = CGRectMake (VIEW1.FRAME.SIZE.WIDTH/2, View1.frame.size.height, View1.frame.size.width, View1.frame.size.height);
CGRect rc = [view2 convertrect:rect fromview:view1];
View2.frame =RC;
/*
The distance from the frame of the current view to the target view, returning to the target location
frame = Rect-view.frame
*/
CGRect rect = CGRectMake (n, A, view1.frame.size.width, view1.frame.size.height);
CGRect rc = [view2 convertrect:rect toview:view1];
View2.frame =RC;
NSLog (@ "%@", Nsstringfromcgrect (RC));
iOS coordinate location translation