convertRect

来源:互联网 发布:regretted it 编辑:程序博客网 时间:2024/05/17 02:47

rectrect所在视图转换到目标视图view中,返回在目标视图view中的rect

     这里用来获取selfwindow上的位置

- (CGRect)convertRect:(CGRect)rect toView:(nullable UIView *)view;

     

例如:在cell中调用

 CGRect toWindow = [selfconvertRect:self.boundstoView:self.window];

toWindow为相对于屏幕的位置
0 0