uiscene uiscene 和 uiwindowscene

uiscene

An object that represents one instance of your app’s user interface.
ios13.0以上的功能,适用于应用双开,一个应用程序对应一个UIScene实例,相互独立,同时进行,每一个实例有不同的状态,可能一个在前台运行一个在后台运行,拥有独立的Windows和controllers,这些实例统一油UIApplication.shared管理,并且有个代理UISceneDelegate处理整个生命周期和事件。
apple introduced Scene, a container for each separate instance of the app. So you can manage each one separately and each of them acts like a separate app. It has its own windows and controllers. But all of them are managed by a single object, UIApplication.shared and it has a delegate to handle general events (usually from outside of the app) and entire application life cycle.

Each scene has its own state and it might be in the foreground while others are in the background or are suspended

参考资料

uiscene

uiwindowscene

在管理window的类,继承UIScene
A scene that manages one or more windows for your app.


image.png
image.png
image.png
image.png

管理生命周期遵守的协议是uiwindoowsceneDelegate用到的代理方法是uiwindoowsceneDelegate的父类uisceneDelegate的代理方法

通常UIKit为每个应用程序创建的实例是UIWindowScene而不是UIScene但用到的方法是UIScene的方法
UIKit creates a scene object for each instance of your app’s UI that the user or your app requests. Typically, UIKit creates a UIWindowScene object instead of a UIScene object, but you use the methods and properties of this class to access information about a scene.

image.png
image.png
image.png

你可能感兴趣的:(uiscene uiscene 和 uiwindowscene)