标签:
建议写一个全局的宏
IOS9的[UIApplication sharedApplication].keyWindow 建议用代理的
+(UIWindow *)getKeyWindow{
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0f){
return [[[UIApplication sharedApplication] delegate] window];
}else{
UIWindow *window = [UIApplication sharedApplication].keyWindow;
if (!window) {
return [[[UIApplication sharedApplication] delegate] window];
}
return window;
}
}
标签:
原文地址:http://www.cnblogs.com/android-wuwei/p/4903534.html