#import "RNNSplitViewController.h" @implementation RNNSplitViewController - (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options presenter:(RNNViewControllerPresenter *)presenter { self = [super init]; self.presenter = presenter; [self.presenter bindViewController:self]; self.options = options; self.layoutInfo = layoutInfo; self.navigationController.delegate = self; [self bindChildViewControllers:childViewControllers]; return self; } - (void)onChildWillAppear { [_presenter applyOptions:self.resolveOptions]; [((UIViewController *)self.parentViewController) onChildWillAppear]; } - (RNNNavigationOptions *)resolveOptions { return (RNNNavigationOptions *)[self.getCurrentChild.resolveOptions.copy mergeOptions:self.options]; } - (void)mergeOptions:(RNNNavigationOptions *)options { [_presenter mergeOptions:options resolvedOptions:self.resolveOptions]; [((UIViewController *)self.parentViewController) mergeOptions:options]; } - (void)bindChildViewControllers:(NSArray *> *)viewControllers { [self setViewControllers:viewControllers]; UIViewController* masterViewController = viewControllers[0]; self.delegate = masterViewController; } -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; } - (UIViewController *)getCurrentChild { return self; } @end