Files
voice-cat/clients/apple/dotnet/VoiceCat.iOS/SceneDelegate.cs
T

23 lines
709 B
C#
Raw Normal View History

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:")]
public void DidEnterBackground(UIScene scene) => AppModel.Shared.Save();
}