| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- 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<App>
- #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<IDeviceId, iOS_DeviceId>();
- PlatformTools.Register<IAppVersion,iOS_AppVersion>();
- PlatformTools.Register<IImageTools, iOS_ImageTools>();
- PlatformTools.Register<IPdfRenderer, iOS_PdfRenderer>();
- PlatformTools.Register<IGeolocation, iOS_Geolocation>();
- PlatformTools.Register<IPermissions, iOS_Permissions>();
-
- 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;
- }
-
- }
|