123456789101112131415161718192021222324252627282930313233343536 |
-
- #import "RNNRootViewController.h"
- #import <React/RCTRootView.h>
-
- @interface RNNRootViewController()
- @property NSString* containerId;
- @property NSString* containerName;
- @property RNNEventEmitter *eventEmitter;
- @end
-
- @implementation RNNRootViewController
-
- -(instancetype)initWithNode:(RNNLayoutNode*)node rootViewCreator:(id<RNNRootViewCreator>)creator eventEmitter:(RNNEventEmitter*)eventEmitter {
- self = [super init];
- self.containerId = node.nodeId;
- self.containerName = node.data[@"name"];
- self.eventEmitter = eventEmitter;
-
- self.view = [creator createRootView:self.containerName rootViewId:self.containerId];
- return self;
- }
-
- -(void)viewDidAppear:(BOOL)animated
- {
- [super viewDidAppear:animated];
- [self.eventEmitter sendContainerStart:self.containerId];
- }
-
- -(void)viewDidDisappear:(BOOL)animated
- {
- [super viewDidDisappear:animated];
- [self.eventEmitter sendContainerStop:self.containerId];
- }
-
- @end
|