/
githubmirror
/
react-native
Обзор
Документация
Войти
/
githubmirror
/
react-native
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
private/helloworld/ios/HelloWorld/SceneDelegate.swift
53 строки
1 KB
artus9033
Add SceneDelegate support (#57700)
11 авг 2026, 13:59
11 авг 2026, 13:59
7bfe32f
Код
Авторство
О чём код?
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import React import ReactAppDependencyProvider import React_RCTAppDelegate import UIKit class SceneDelegate: RCTDefaultReactNativeFactoryDelegate, UIWindowSceneDelegate { var window: UIWindow? var reactNativeFactory: RCTReactNativeFactory? func scene( _ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions ) { guard let windowScene = scene as? UIWindowScene else { return } dependencyProvider = RCTAppDependencyProvider() reactNativeFactory = RCTReactNativeFactory(delegate: self) window = UIWindow(windowScene: windowScene) reactNativeFactory?.startReactNative( withModuleName: "HelloWorld", in: window, connectionOptions: connectionOptions ) } func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { RCTLinkingManager.scene(scene, openURLContexts: URLContexts) } func scene(_ scene: UIScene, continue userActivity: NSUserActivity) { RCTLinkingManager.scene(scene, continue: userActivity) } override func bundleURL() -> URL? { #if DEBUG RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") #else Bundle.main.url(forResource: "main", withExtension: "jsbundle") #endif } }