react-native-navigation的迁移库

RNNSplitViewController.m 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #import "RNNSplitViewController.h"
  2. @implementation RNNSplitViewController
  3. -(instancetype)initWithOptions:(RNNSplitViewOptions*)options
  4. withComponentId:(NSString*)componentId
  5. rootViewCreator:(id<RNNRootViewCreator>)creator
  6. eventEmitter:(RNNEventEmitter*)eventEmitter {
  7. self = [super init];
  8. self.componentId = componentId;
  9. self.options = options;
  10. self.eventEmitter = eventEmitter;
  11. self.creator = creator;
  12. self.navigationController.delegate = self;
  13. return self;
  14. }
  15. -(void)viewWillAppear:(BOOL)animated{
  16. [super viewWillAppear:animated];
  17. [self.options applyOn:self];
  18. }
  19. - (UIViewController *)getLeafViewController {
  20. return self;
  21. }
  22. - (void)performOnChildLoad:(RNNNavigationOptions *)childOptions {
  23. RNNNavigationOptions* combinedOptions = [_presenter presentWithChildOptions:childOptions on:self];
  24. if ([self.parentViewController respondsToSelector:@selector(performOnChildLoad:)]) {
  25. [self.parentViewController performSelector:@selector(performOnChildLoad:) withObject:combinedOptions];
  26. }
  27. }
  28. - (void)performOnChildWillAppear:(RNNNavigationOptions *)childOptions {
  29. RNNNavigationOptions* combinedOptions = [_presenter presentWithChildOptions:childOptions on:self];
  30. if ([self.parentViewController respondsToSelector:@selector(performOnChildWillAppear:)]) {
  31. [self.parentViewController performSelector:@selector(performOnChildWillAppear:) withObject:combinedOptions];
  32. }
  33. }
  34. @end