Add hosting view controller for RN Root View
This commit is contained in:
parent
9829024b2c
commit
14aa6a777b
2 changed files with 44 additions and 6 deletions
29
ios/Native/UIReactNativeHostingViewController.swift
Normal file
29
ios/Native/UIReactNativeHostingViewController.swift
Normal file
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// UIReactNativeHostingViewController.swift
|
||||
// RNPlayground
|
||||
//
|
||||
// Created by Artur Gurgul on 01/08/2025.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import React
|
||||
import React_RCTAppDelegate
|
||||
import ReactAppDependencyProvider
|
||||
|
||||
class UIReactNativeHostingViewController: UIViewController {
|
||||
|
||||
var factory: RCTReactNativeFactory
|
||||
|
||||
init(_ reactNativeFactory: RCTReactNativeFactory) {
|
||||
self.factory = reactNativeFactory
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func loadView() {
|
||||
view = factory.rootViewFactory.view(withModuleName: "RNPlayground")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue