react-native-navigation的迁移库

RNNRootViewController.m 826B

12345678910111213141516171819202122232425262728293031323334353637
  1. #import "RNNRootViewController.h"
  2. #import <React/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 rootViewCreator:(id<RNNRootViewCreator>)creator
  10. {
  11. self = [super init];
  12. self.containerId = node.nodeId;
  13. self.containerName = node.data[@"name"];
  14. self.view = [creator createRootView:self.containerName rootViewId:self.containerId];
  15. return self;
  16. }
  17. -(void)viewDidAppear:(BOOL)animated
  18. {
  19. [super viewDidAppear:animated];
  20. [[RNN instance].eventEmitter sendContainerStart:self.containerId];
  21. }
  22. -(void)viewDidDisappear:(BOOL)animated
  23. {
  24. [super viewDidDisappear:animated];
  25. [[RNN instance].eventEmitter sendContainerStop:self.containerId];
  26. }
  27. @end