2026-09-19 15:43:37 +02:00
|
|
|
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:")]
|
2026-09-19 20:09:00 +02:00
|
|
|
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();
|
2026-09-19 15:43:37 +02:00
|
|
|
}
|