Browse Source

rename navigationOptions ios

Daniel Zlotin 6 years ago
parent
commit
9464f6f6a6

+ 2
- 2
lib/ios/RNNCommandsHandler.m View File

@@ -41,11 +41,11 @@
41 41
 	UIViewController* vc = [_store findComponentForId:componentId];
42 42
 	if([vc isKindOfClass:[RNNRootViewController class]]) {
43 43
 		RNNRootViewController* rootVc = (RNNRootViewController*)vc;
44
-		[rootVc.navigationOptions mergeWith:options];
44
+		[rootVc.options mergeWith:options];
45 45
 		[CATransaction begin];
46 46
 		[CATransaction setCompletionBlock:completion];
47 47
 		
48
-		[rootVc.navigationOptions applyOn:vc];
48
+		[rootVc.options applyOn:vc];
49 49
 		
50 50
 		[CATransaction commit];
51 51
 	}

+ 12
- 12
lib/ios/RNNNavigationOptions.m View File

@@ -17,19 +17,19 @@ const NSInteger TOP_BAR_TRANSPARENT_TAG = 78264803;
17 17
 	return [self initWithDict:@{}];
18 18
 }
19 19
 
20
--(instancetype)initWithDict:(NSDictionary *)navigationOptions {
20
+-(instancetype)initWithDict:(NSDictionary *)options {
21 21
 	self = [super init];
22
-	self.statusBarHidden = [navigationOptions objectForKey:@"statusBarHidden"];
23
-	self.screenBackgroundColor = [navigationOptions objectForKey:@"screenBackgroundColor"];
24
-	self.backButtonTransition = [navigationOptions objectForKey:@"backButtonTransition"];
25
-	self.orientation = [navigationOptions objectForKey:@"orientation"];
26
-	self.topBar = [[RNNTopBarOptions alloc] initWithDict:[navigationOptions objectForKey:@"topBar"]];
27
-	self.topTab = [[RNNTopTabOptions alloc] initWithDict:[navigationOptions objectForKey:@"topTab"]];
28
-	self.bottomTabs = [[RNNBottomTabsOptions alloc] initWithDict:[navigationOptions objectForKey:@"bottomTabs"]];
29
-	self.sideMenu = [[RNNSideMenuOptions alloc] initWithDict:[navigationOptions objectForKey:@"sideMenu"]];
30
-	self.backgroundImage = [RCTConvert UIImage:[navigationOptions objectForKey:@"backgroundImage"]];
31
-	self.rootBackgroundImage = [RCTConvert UIImage:[navigationOptions objectForKey:@"rootBackgroundImage"]];
32
-	self.bottomTab = [[RNNBottomTabOptions alloc] initWithDict:[navigationOptions objectForKey:@"bottomTab"]];
22
+	self.statusBarHidden = [options objectForKey:@"statusBarHidden"];
23
+	self.screenBackgroundColor = [options objectForKey:@"screenBackgroundColor"];
24
+	self.backButtonTransition = [options objectForKey:@"backButtonTransition"];
25
+	self.orientation = [options objectForKey:@"orientation"];
26
+	self.topBar = [[RNNTopBarOptions alloc] initWithDict:[options objectForKey:@"topBar"]];
27
+	self.topTab = [[RNNTopTabOptions alloc] initWithDict:[options objectForKey:@"topTab"]];
28
+	self.bottomTabs = [[RNNBottomTabsOptions alloc] initWithDict:[options objectForKey:@"bottomTabs"]];
29
+	self.sideMenu = [[RNNSideMenuOptions alloc] initWithDict:[options objectForKey:@"sideMenu"]];
30
+	self.backgroundImage = [RCTConvert UIImage:[options objectForKey:@"backgroundImage"]];
31
+	self.rootBackgroundImage = [RCTConvert UIImage:[options objectForKey:@"rootBackgroundImage"]];
32
+	self.bottomTab = [[RNNBottomTabOptions alloc] initWithDict:[options objectForKey:@"bottomTab"]];
33 33
     
34 34
 	return self;
35 35
 }

+ 1
- 1
lib/ios/RNNRootViewController.h View File

@@ -11,7 +11,7 @@
11 11
 
12 12
 @interface RNNRootViewController : UIViewController	<RNNRootViewProtocol>
13 13
 
14
-@property (nonatomic, strong) RNNNavigationOptions* navigationOptions;
14
+@property (nonatomic, strong) RNNNavigationOptions* options;
15 15
 @property (nonatomic, strong) RNNAnimator* animator;
16 16
 @property (nonatomic, strong) RNNEventEmitter *eventEmitter;
17 17
 @property (nonatomic, strong) NSString* componentId;

+ 10
- 10
lib/ios/RNNRootViewController.m View File

@@ -20,7 +20,7 @@
20 20
 	self = [super init];
21 21
 	self.componentId = componentId;
22 22
 	self.componentName = name;
23
-	self.navigationOptions = options;
23
+	self.options = options;
24 24
 	self.eventEmitter = eventEmitter;
25 25
 	self.animator = animator;
26 26
 	self.view = [creator createRootView:self.componentName rootViewId:self.componentId];
@@ -37,7 +37,7 @@
37 37
 	
38 38
 -(void)viewWillAppear:(BOOL)animated{
39 39
 	[super viewWillAppear:animated];
40
-	[self.navigationOptions applyOn:self];
40
+	[self.options applyOn:self];
41 41
 }
42 42
 
43 43
 - (void)viewDidLoad {
@@ -49,22 +49,22 @@
49 49
 }
50 50
 
51 51
 - (BOOL)prefersStatusBarHidden {
52
-	if ([self.navigationOptions.statusBarHidden boolValue]) {
52
+	if ([self.options.statusBarHidden boolValue]) {
53 53
 		return YES;
54
-	} else if ([self.navigationOptions.statusBarHideWithTopBar boolValue]) {
54
+	} else if ([self.options.statusBarHideWithTopBar boolValue]) {
55 55
 		return self.navigationController.isNavigationBarHidden;
56 56
 	}
57 57
 	return NO;
58 58
 }
59 59
 
60 60
 - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
61
-	return self.navigationOptions.supportedOrientations;
61
+	return self.options.supportedOrientations;
62 62
 }
63 63
 
64 64
 - (BOOL)hidesBottomBarWhenPushed
65 65
 {
66
-	if (self.navigationOptions.bottomTabs && self.navigationOptions.bottomTabs.hidden) {
67
-		return [self.navigationOptions.bottomTabs.hidden boolValue];
66
+	if (self.options.bottomTabs && self.options.bottomTabs.hidden) {
67
+		return [self.options.bottomTabs.hidden boolValue];
68 68
 	}
69 69
 	return NO;
70 70
 }
@@ -81,7 +81,7 @@
81 81
 
82 82
 - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
83 83
 	RNNRootViewController* vc =  (RNNRootViewController*)viewController;
84
-	if (![vc.navigationOptions.backButtonTransition isEqualToString:@"custom"]){
84
+	if (![vc.options.backButtonTransition isEqualToString:@"custom"]){
85 85
 		navigationController.delegate = nil;
86 86
 	}
87 87
 }
@@ -104,11 +104,11 @@
104 104
 }
105 105
 
106 106
 -(void)applyTabBarItem {
107
-	[self.navigationOptions.bottomTab applyOn:self];
107
+	[self.options.bottomTab applyOn:self];
108 108
 }
109 109
 
110 110
 -(void)applyTopTabsOptions {
111
-	[self.navigationOptions.topTab applyOn:self];
111
+	[self.options.topTab applyOn:self];
112 112
 }
113 113
 
114 114
 /**