react-native-navigation的迁移库

RNNRootViewController.m 849B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #import "RNNRootViewController.h"
  2. #import "RCTRootView.h"
  3. #import "RNN.h"
  4. @interface RNNRootViewController()
  5. @property NSString* containerId;
  6. @property NSString* containerName;
  7. @end
  8. @implementation RNNRootViewController
  9. -(instancetype)initWithNode:(RNNLayoutNode*)node
  10. {
  11. self = [super init];
  12. self.containerId = node.nodeId;
  13. self.containerName = node.data[@"name"];
  14. self.view = [[RCTRootView alloc] initWithBridge:RNN.instance.bridge
  15. moduleName:self.containerName
  16. initialProperties:@{@"id": self.containerId}];
  17. return self;
  18. }
  19. -(void)viewDidAppear:(BOOL)animated
  20. {
  21. [super viewDidAppear:animated];
  22. [RNN.instance.eventEmitter sendContainerStart:self.containerId];
  23. }
  24. -(void)viewDidDisappear:(BOOL)animated
  25. {
  26. [super viewDidDisappear:animated];
  27. [RNN.instance.eventEmitter sendContainerStop:self.containerId];
  28. }
  29. @end