Browse Source

rename navigationOptions ios

Daniel Zlotin 6 years ago
parent
commit
9464f6f6a6

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

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

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

17
 	return [self initWithDict:@{}];
17
 	return [self initWithDict:@{}];
18
 }
18
 }
19
 
19
 
20
--(instancetype)initWithDict:(NSDictionary *)navigationOptions {
20
+-(instancetype)initWithDict:(NSDictionary *)options {
21
 	self = [super init];
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
 	return self;
34
 	return self;
35
 }
35
 }

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

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

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

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