using System; using System.Threading.Tasks; using Avalonia; using Avalonia.iOS; using Foundation; using InABox.Avalonia.Platform; using InABox.Avalonia.Platform.iOS; using UIKit; using Microsoft.Maui.ApplicationModel; namespace PRS.Avalonia.iOS; // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register("AppDelegate")] #pragma warning disable CA1711 // Identifiers should not have incorrect suffix public partial class AppDelegate : AvaloniaAppDelegate #pragma warning restore CA1711 // Identifiers should not have incorrect suffix { protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) { // Set up a getter for the top-most view controller UIViewController GetTopController() => this.Window?.RootViewController!; // Initialize Essentials Platform.Init(GetTopController); PlatformTools.Register(); PlatformTools.Register(); PlatformTools.Register(); PlatformTools.Register(); PlatformTools.Register(); PlatformTools.Register(); var result = base.CustomizeAppBuilder(builder); result = result.UseSkia(); result = result.WithInterFont(); //if (Runtime.Arch == Arch.SIMULATOR) result = result.With(new iOSPlatformOptions { RenderingMode = [iOSRenderingMode.OpenGl] }); return result; } }