获取UIWindow
1,UIWindow *window = [UIApplication sharedApplication].keyWindow; // 获得根窗口2.
- (UIView *)rootView {
UIView *rootView = self;
while (rootView.superview) {
if ([rootView.superview isKindOfClass:[UIWindow class]]) {
break;
}
rootView = rootView.superview;
}
return rootView;
}
补充:移动开发 , IOS ,