#import "RNNSideMenuChildVC.h" @interface RNNSideMenuChildVC () @property (readwrite) RNNSideMenuChildType type; @property (nonatomic, retain) UIViewController *child; @end @implementation RNNSideMenuChildVC - (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options optionsResolver:(RNNParentOptionsResolver *)optionsResolver presenter:(RNNBasePresenter *)presenter type:(RNNSideMenuChildType)type { self = [self initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options optionsResolver:optionsResolver presenter:presenter]; self.type = type; return self; } - (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options optionsResolver:(RNNParentOptionsResolver *)optionsResolver presenter:(RNNBasePresenter *)presenter { self = [super init]; self.presenter = presenter; self.options = options; self.layoutInfo = layoutInfo; self.optionsResolver = optionsResolver; [self bindChildViewControllers:childViewControllers]; return self; } - (void)bindChildViewControllers:(NSArray *> *)viewControllers { UIViewController* child = viewControllers[0]; self.child = child; [self addChildViewController:self.child]; [self.child.view setFrame:self.view.bounds]; [self.view addSubview:self.child.view]; [self.view bringSubviewToFront:self.child.view]; } - (UIViewController *)getLeafViewController { return [self.child getLeafViewController]; } - (void)willMoveToParentViewController:(UIViewController *)parent { [_optionsResolver resolve:self with:self.childViewControllers]; [_presenter present:self.options onViewControllerDidLoad:self]; } - (void)mergeOptions:(RNNNavigationOptions *)options { [self.options mergeOptions:options overrideOptions:YES]; [self.presenter present:self.options onViewControllerWillAppear:self]; } - (UIStatusBarStyle)preferredStatusBarStyle { return self.child.preferredStatusBarStyle; } @end