12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #import "RNNSideMenuChildVC.h"
-
- @interface RNNSideMenuChildVC ()
-
- @property (readwrite) RNNSideMenuChildType type;
- @property (nonatomic, retain) UIViewController<RNNParentProtocol> *child;
-
- @end
-
- @implementation RNNSideMenuChildVC
-
- - (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options presenter:(RNNBasePresenter *)presenter type:(RNNSideMenuChildType)type {
- self = [self initWithLayoutInfo:layoutInfo childViewControllers:childViewControllers options:options presenter:presenter];
-
- self.type = type;
-
- return self;
- }
-
- - (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo childViewControllers:(NSArray *)childViewControllers options:(RNNNavigationOptions *)options presenter:(RNNBasePresenter *)presenter {
- self = [super init];
-
- self.presenter = presenter;
- self.options = options;
- self.layoutInfo = layoutInfo;
-
- [self bindChildViewControllers:childViewControllers];
-
- return self;
- }
-
- - (void)bindChildViewControllers:(NSArray<UIViewController<RNNParentProtocol> *> *)viewControllers {
- UIViewController<RNNParentProtocol>* 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 {
- [_presenter present:self.options onViewControllerDidLoad:self];
- }
-
- - (UIStatusBarStyle)preferredStatusBarStyle {
- return self.child.preferredStatusBarStyle;
- }
-
- @end
|