guardia-messenger/node_modules/expo-modules-core/ios/ReactDelegates/ExpoReactDelegate.swift
DESKTOP-TKLFCPRython f29f525c77 refactor: 101.79.17.164 → zioinfo.co.kr 전체 도메인 변환 + Manager UI 배포
- 37개 파일 IP → zioinfo.co.kr 치환 (소스/매뉴얼/설정/하네스)
- Manager DrConsole/NetworkConsole/CsapConsole 빌드 + /var/www/manager/ 배포
- 테스트: Manager HTTP 200, ITSM 신규 API 7개 전체 200

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 10:09:17 +09:00

61 lines
1.9 KiB
Swift

// Copyright 2018-present 650 Industries. All rights reserved.
/**
An extensible react instance creation delegate. This class will loop through each `ExpoReactDelegateHandler` to determine the winner to create the instance.
*/
@objc(EXReactDelegate)
public class ExpoReactDelegate: NSObject {
private let handlers: [ExpoReactDelegateHandler]
public init(handlers: [ExpoReactDelegateHandler]) {
self.handlers = handlers
}
#if os(iOS) || os(tvOS)
@objc
public func createReactRootView(
moduleName: String,
initialProperties: [AnyHashable: Any]?,
launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> UIView {
return self.handlers.lazy
.compactMap { $0.createReactRootView(reactDelegate: self, moduleName: moduleName, initialProperties: initialProperties, launchOptions: launchOptions) }
.first(where: { _ in true })
?? {
guard let rctAppDelegate = (UIApplication.shared.delegate as? RCTAppDelegate) else {
fatalError("The `UIApplication.shared.delegate` is not a `RCTAppDelegate` instance.")
}
return rctAppDelegate.recreateRootView(
withBundleURL: nil,
moduleName: moduleName,
initialProps: initialProperties,
launchOptions: launchOptions
)
}()
}
#elseif os(macOS)
@objc
public func createReactRootView(
moduleName: String,
initialProperties: [AnyHashable: Any]?,
launchOptions: [AnyHashable: Any]?
) -> UIView {
return UIView()
}
#endif
@objc
public func bundleURL() -> URL? {
return self.handlers.lazy
.compactMap { $0.bundleURL(reactDelegate: self) }
.first(where: { _ in true })
}
@objc
public func createRootViewController() -> UIViewController {
return self.handlers.lazy
.compactMap { $0.createRootViewController(reactDelegate: self) }
.first(where: { _ in true }) ?? UIViewController()
}
}