Exemplo n.º 1
0
        public static UIViewController CreateViewController(this Page page)
        {
            if (!System.Maui.Maui.IsInitialized)
            {
                throw new InvalidOperationException("call System.Maui.Maui.Init() before this");
            }

            if (!(page.RealParent is Application))
            {
                Application app = new EmbeddedApplication();
                app.MainPage = page;
            }

            var result = new Platform.iOS.Platform();

            result.SetPage(page);
            return(result.ViewController);
        }