AppDelegate.swift 956 B

123456789101112131415161718192021222324252627282930
  1. import UIKit
  2. import React
  3. import React_RCTAppDelegate
  4. import ReactAppDependencyProvider
  5. @main
  6. class AppDelegate: RCTAppDelegate {
  7. override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
  8. self.moduleName = "RNExampleProject"
  9. self.dependencyProvider = RCTAppDependencyProvider()
  10. // You can add your custom initial props in the dictionary below.
  11. // They will be passed down to the ViewController used by React Native.
  12. self.initialProps = [:]
  13. return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  14. }
  15. override func sourceURL(for bridge: RCTBridge) -> URL? {
  16. self.bundleURL()
  17. }
  18. override func bundleURL() -> URL? {
  19. #if DEBUG
  20. RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
  21. #else
  22. Bundle.main.url(forResource: "main", withExtension: "jsbundle")
  23. #endif
  24. }
  25. }