convertRect view之间坐标系的转换

UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
CGRect converControlTagRect = [self convertRect:self.controlTagView.frame toView:keyWindow];
[self.controlTagView removeFromSuperview];
self.controlTagView.frame = converControlTagRect;
[keyWindow addSubview:self.controlTagView];

CGRect originalRect = self.frame;
CGRect popUpRect = CGRectMake(0, originalRect.origin.y-hotViewHeight, self.frame.size.width, originalRect.size.height+hotViewHeight);
[UIView animateWithDuration:0.4f delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.frame = popUpRect;
} completion:^(BOOL finished) {

}];

原文地址:https://www.cnblogs.com/xilanglang/p/6370313.html