Retire legacy implementations and flatten managed layout
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace VoiceCat.iOS;
|
||||
|
||||
[Register("SceneDelegate")]
|
||||
internal sealed class SceneDelegate : UIResponder, IUIWindowSceneDelegate
|
||||
{
|
||||
[Export("window")]
|
||||
public UIWindow? Window { get; set; }
|
||||
|
||||
[Export("scene:willConnectToSession:options:")]
|
||||
public void WillConnect(UIScene scene, UISceneSession session, UISceneConnectionOptions options)
|
||||
{
|
||||
if (scene is not UIWindowScene windowScene) return;
|
||||
Window = new(windowScene) { RootViewController = new RootViewController(AppModel.Shared) };
|
||||
Window.MakeKeyAndVisible();
|
||||
}
|
||||
|
||||
[Export("sceneDidEnterBackground:")]
|
||||
public void DidEnterBackground(UIScene scene) => AppModel.Shared.DidEnterBackground();
|
||||
|
||||
[Export("sceneWillEnterForeground:")]
|
||||
public void WillEnterForeground(UIScene scene) => AppModel.Shared.WillEnterForeground();
|
||||
|
||||
[Export("sceneDidBecomeActive:")]
|
||||
public void DidBecomeActive(UIScene scene) => AppModel.Shared.DidBecomeActive();
|
||||
}
|
||||
Reference in New Issue
Block a user