【源码】iOS获取UIWindow
这种有时候不行:
UIWindow *window = [[UIApplication sharedApplication] keyWindow];
下面这些任何情况都可以:
UIWindow *window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
UIWindow *window =[[UIApplication sharedApplication].delegate window];
UIWindow *window = [[[UIApplication sharedApplication] delegate] window];
UIWindow *window = [UIApplication sharedApplication].windows[0];
另外,
我的心愿是
世界
和平