react-native-navigation的迁移库

RNNReactRootViewCreator.m 661B

123456789101112131415161718192021222324252627282930
  1. //
  2. // RNNReactRootViewCreator.m
  3. // ReactNativeNavigation
  4. //
  5. // Created by Ran Greenberg on 08/02/2017.
  6. // Copyright © 2017 Wix. All rights reserved.
  7. //
  8. #import "RNNReactRootViewCreator.h"
  9. #import "RNN.h"
  10. #import <React/RCTRootView.h>
  11. @implementation RNNReactRootViewCreator
  12. - (UIView*)createRootView:(NSString*)name rootViewId:(NSString*)rootViewId
  13. {
  14. if (!rootViewId) {
  15. @throw [NSException exceptionWithName:@"MissingViewId" reason:@"Missing view id" userInfo:nil];
  16. }
  17. UIView *view = [[RCTRootView alloc] initWithBridge:[RNN instance].bridge
  18. moduleName:name
  19. initialProperties:@{@"id": rootViewId}];
  20. return view;
  21. }
  22. @end