react-native-navigation的迁移库

AppDelegate.m 756B

12345678910111213141516171819202122
  1. #import <React/RCTBundleURLProvider.h>
  2. #import <ReactNativeNavigation/ReactNativeNavigation.h>
  3. #import "AppDelegate.h"
  4. #import <ReactNativeNavigation/RNNCustomViewController.h>
  5. @implementation AppDelegate
  6. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  7. {
  8. NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  9. [ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions];
  10. [ReactNativeNavigation registerExternalComponent:@"RNNCustomComponent" callback:^UIViewController *(NSDictionary *props, RCTBridge *bridge) {
  11. return [[RNNCustomViewController alloc] initWithProps:props];
  12. }];
  13. return YES;
  14. }
  15. @end