[UIApplication sharedApplication].keyWindow和[[UIApplication sharedApplication].delegate window]区别

viewDidLoad:方法中[UIApplication sharedApplication].keyWindow还没有创建成功
但是[[UIApplication sharedApplication].delegate window]是存在的
建议使用[[UIApplication sharedApplication].delegate window]

参考:https://www.jianshu.com/p/353f4271673c

你可能感兴趣的:([UIApplication sharedApplication].keyWindow和[[UIApplication sharedApplication].delegate window]区别)