Add hosting view controller for RN Root View

This commit is contained in:
Artur Gurgul 2025-08-01 21:02:00 +02:00
parent 9829024b2c
commit 14aa6a777b
2 changed files with 44 additions and 6 deletions

View file

@ -22,15 +22,24 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
reactNativeFactory = factory
window = UIWindow(frame: UIScreen.main.bounds)
factory.startReactNative(
withModuleName: "RNPlayground",
in: window,
launchOptions: launchOptions
)
startNativeApp()
// factory.startReactNative(
// withModuleName: "RNPlayground",
// in: window,
// launchOptions: launchOptions
// )
return true
}
func startNativeApp() {
guard let window, let reactNativeFactory else {
return
}
window.rootViewController = UIReactNativeHostingViewController(reactNativeFactory)
window.makeKeyAndVisible()
}
}
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {