diff --git a/test-apps/ios-test-app/App/App/AppDelegate.swift b/test-apps/ios-test-app/App/App/AppDelegate.swift index ebb0508..96e2a3a 100644 --- a/test-apps/ios-test-app/App/App/AppDelegate.swift +++ b/test-apps/ios-test-app/App/App/AppDelegate.swift @@ -37,9 +37,21 @@ class AppDelegate: UIResponder, UIApplicationDelegate { print("AppDelegate: Creating ViewController") NSLog("AppDelegate: Creating ViewController") - let viewController = ViewController() - window.rootViewController = viewController - window.makeKeyAndVisible() + // Use storyboard to load ViewController (Capacitor's standard approach) + let storyboard = UIStoryboard(name: "Main", bundle: nil) + if let viewController = storyboard.instantiateInitialViewController() as? CAPBridgeViewController { + window.rootViewController = viewController + window.makeKeyAndVisible() + print("AppDelegate: ViewController loaded from storyboard") + NSLog("AppDelegate: ViewController loaded from storyboard") + } else { + // Fallback: Create ViewController programmatically + let viewController = CAPBridgeViewController() + window.rootViewController = viewController + window.makeKeyAndVisible() + print("AppDelegate: ViewController created programmatically (fallback)") + NSLog("AppDelegate: ViewController created programmatically (fallback)") + } print("AppDelegate: Window made key and visible") NSLog("AppDelegate: Window made key and visible")