欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

UIApplication 的 keyWindow

程序员文章站 2024-01-15 08:01:58
...
@property(nullable, nonatomic,readonly) UIWindow *keyWindow 
API_DEPRECATED("Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes", ios(2.0, 13.0));

AppDelegate.window
== [[UIApplication sharedApplication] keyWindow]
== [[UIApplication sharedApplication] windows][0]

需要在window上添加视图时,可以使用

UIWindow *window = [[UIApplication sharedApplication] windows][0];
相关标签: iOS 记录