yogevbd 6 gadus atpakaļ
vecāks
revīzija
797ccbeda8

+ 3
- 4
lib/ios/RNNControllerFactory.m Parādīt failu

@@ -125,9 +125,9 @@
125 125
 
126 126
 
127 127
 - (UIViewController<RNNRootViewProtocol> *)createStack:(RNNLayoutNode*)node {
128
-	RNNNavigationController* vc = [[RNNNavigationController alloc] init];
129
-	[vc setComponentId:node.nodeId];
130 128
 	RNNNavigationOptions* options = [self createOptions:node.data[@"options"]];
129
+	RNNNavigationController* vc = [[RNNNavigationController alloc] initWithOptions:options];
130
+	[vc setComponentId:node.nodeId];
131 131
 	NSMutableArray* controllers = [NSMutableArray new];
132 132
 	for (NSDictionary* child in node.children) {
133 133
 		[controllers addObject:[self fromTree:child]];
@@ -145,8 +145,7 @@
145 145
 	NSMutableArray* controllers = [NSMutableArray new];
146 146
 	for (NSDictionary *child in node.children) {
147 147
 		UIViewController<RNNRootViewProtocol>* childVc = [self fromTree:child];
148
-		RNNRootViewController* rootView = (RNNRootViewController *)[childVc getLeafViewController];
149
-		[rootView applyTabBarItem];
148
+		[childVc applyTabBarItem];
150 149
 		
151 150
 		[controllers addObject:childVc];
152 151
 	}

+ 3
- 0
lib/ios/RNNNavigationController.h Parādīt failu

@@ -3,6 +3,9 @@
3 3
 
4 4
 @interface RNNNavigationController : UINavigationController <RNNRootViewProtocol>
5 5
 
6
+- (instancetype)initWithOptions:(RNNNavigationOptions *)options;
7
+
6 8
 @property (nonatomic, strong) NSString* componentId;
9
+@property (nonatomic, strong) RNNNavigationOptions* options;
7 10
 
8 11
 @end

+ 16
- 0
lib/ios/RNNNavigationController.m Parādīt failu

@@ -4,6 +4,15 @@
4 4
 
5 5
 @implementation RNNNavigationController
6 6
 
7
+- (instancetype)initWithOptions:(RNNNavigationOptions *)options {
8
+	self = [super init];
9
+	if (self) {
10
+		_options = options;
11
+	}
12
+	
13
+	return self;
14
+}
15
+
7 16
 - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
8 17
 	return self.viewControllers.lastObject.supportedInterfaceOrientations;
9 18
 }
@@ -44,4 +53,11 @@
44 53
 	return self.topViewController;
45 54
 }
46 55
 
56
+- (void)applyTabBarItem {
57
+	[self.options.bottomTab mergeOptions:((RNNNavigationOptions *)self.options.defaultOptions).bottomTab overrideOptions:NO];
58
+	[self.options.bottomTab applyOn:self];
59
+	[self.getLeafViewController.options.bottomTab mergeOptions:((RNNNavigationOptions *)self.getLeafViewController.options.defaultOptions).bottomTab overrideOptions:NO];
60
+	[self.getLeafViewController.options.bottomTab applyOn:self];
61
+}
62
+
47 63
 @end

+ 0
- 1
lib/ios/RNNRootViewController.h Parādīt failu

@@ -25,7 +25,6 @@ typedef void (^RNNReactViewReadyCompletionBlock)(void);
25 25
 			   eventEmitter:(RNNEventEmitter*)eventEmitter
26 26
 		  isExternalComponent:(BOOL)isExternalComponent;
27 27
 
28
-- (void)applyTabBarItem;
29 28
 - (void)applyTopTabsOptions;
30 29
 - (BOOL)isCustomViewController;
31 30
 - (BOOL)isCustomTransitioned;

+ 1
- 0
lib/ios/RNNRootViewProtocol.h Parādīt failu

@@ -6,6 +6,7 @@
6 6
 @optional
7 7
 
8 8
 - (void)performOnRotation:(void (^)(void))block;
9
+- (void)applyTabBarItem;
9 10
 
10 11
 @required
11 12
 - (RNNRootViewController *)getLeafViewController;