浏览代码

Rename enabled to enable in animation options - ios

yogevbd 6 年前
父节点
当前提交
44b105fdf6

+ 2
- 2
lib/ios/RNNModalManager.m 查看文件

25
 	if (topVC.options.animations.showModal.hasCustomAnimation) {
25
 	if (topVC.options.animations.showModal.hasCustomAnimation) {
26
 		self.toVC.transitioningDelegate = topVC;
26
 		self.toVC.transitioningDelegate = topVC;
27
 	}
27
 	}
28
-	[topVC presentViewController:self.toVC animated:self.toVC.options.animations.showModal.enabled completion:^{
28
+	[topVC presentViewController:self.toVC animated:self.toVC.options.animations.showModal.enable completion:^{
29
 		if (_completionBlock) {
29
 		if (_completionBlock) {
30
 			_completionBlock();
30
 			_completionBlock();
31
 			_completionBlock = nil;
31
 			_completionBlock = nil;
74
 	}
74
 	}
75
 	
75
 	
76
 	if (modalToDismiss == topPresentedVC || [[topPresentedVC childViewControllers] containsObject:modalToDismiss]) {
76
 	if (modalToDismiss == topPresentedVC || [[topPresentedVC childViewControllers] containsObject:modalToDismiss]) {
77
-		[modalToDismiss dismissViewControllerAnimated:modalToDismiss.options.animations.dismissModal.enabled completion:^{
77
+		[modalToDismiss dismissViewControllerAnimated:modalToDismiss.options.animations.dismissModal.enable completion:^{
78
 			[[_store pendingModalIdsToDismiss] removeObject:componentId];
78
 			[[_store pendingModalIdsToDismiss] removeObject:componentId];
79
 			[_store removeComponent:componentId];
79
 			[_store removeComponent:componentId];
80
 			[self removePendingNextModalIfOnTop];
80
 			[self removePendingNextModalIfOnTop];

+ 7
- 7
lib/ios/RNNNavigationStackManager.m 查看文件

57
 		}
57
 		}
58
 	}];
58
 	}];
59
 	
59
 	
60
-	[[self.fromVC navigationController] pushViewController:self.toVC animated:self.toVC.options.animations.push.enabled];
60
+	[[self.fromVC navigationController] pushViewController:self.toVC animated:self.toVC.options.animations.push.enable];
61
 	[CATransaction commit];
61
 	[CATransaction commit];
62
 	
62
 	
63
 	self.toVC = nil;
63
 	self.toVC = nil;
71
 	if ([nvc topViewController] == vc) {
71
 	if ([nvc topViewController] == vc) {
72
 		if (vc.options.animations.pop) {
72
 		if (vc.options.animations.pop) {
73
 			nvc.delegate = vc;
73
 			nvc.delegate = vc;
74
-			[nvc popViewControllerAnimated:vc.options.animations.pop.enabled];
74
+			[nvc popViewControllerAnimated:vc.options.animations.pop.enable];
75
 		} else {
75
 		} else {
76
 			nvc.delegate = nil;
76
 			nvc.delegate = nil;
77
-			[nvc popViewControllerAnimated:vc.options.animations.pop.enabled];
77
+			[nvc popViewControllerAnimated:vc.options.animations.pop.enable];
78
 		}
78
 		}
79
 	} else {
79
 	} else {
80
 		NSMutableArray * vcs = nvc.viewControllers.mutableCopy;
80
 		NSMutableArray * vcs = nvc.viewControllers.mutableCopy;
81
 		[vcs removeObject:vc];
81
 		[vcs removeObject:vc];
82
-		[nvc setViewControllers:vcs animated:vc.options.animations.pop.enabled];
82
+		[nvc setViewControllers:vcs animated:vc.options.animations.pop.enable];
83
 	}
83
 	}
84
 	[_store removeComponent:componentId];
84
 	[_store removeComponent:componentId];
85
 }
85
 }
90
 	if (vc) {
90
 	if (vc) {
91
 		UINavigationController *nvc = [vc navigationController];
91
 		UINavigationController *nvc = [vc navigationController];
92
 		if(nvc) {
92
 		if(nvc) {
93
-			NSArray *poppedVCs = [nvc popToViewController:vc animated:vc.options.animations.pop.enabled];
93
+			NSArray *poppedVCs = [nvc popToViewController:vc animated:vc.options.animations.pop.enable];
94
 			[self removePopedViewControllers:poppedVCs];
94
 			[self removePopedViewControllers:poppedVCs];
95
 		}
95
 		}
96
 	}
96
 	}
99
 -(void)popToRoot:(NSString*)componentId {
99
 -(void)popToRoot:(NSString*)componentId {
100
 	RNNRootViewController *vc = (RNNRootViewController*)[_store findComponentForId:componentId];
100
 	RNNRootViewController *vc = (RNNRootViewController*)[_store findComponentForId:componentId];
101
 	UINavigationController* nvc = [vc navigationController];
101
 	UINavigationController* nvc = [vc navigationController];
102
-	NSArray* poppedVCs = [nvc popToRootViewControllerAnimated:vc.options.animations.pop.enabled];
102
+	NSArray* poppedVCs = [nvc popToRootViewControllerAnimated:vc.options.animations.pop.enable];
103
 	[self removePopedViewControllers:poppedVCs];
103
 	[self removePopedViewControllers:poppedVCs];
104
 }
104
 }
105
 
105
 
113
 		}
113
 		}
114
 	}];
114
 	}];
115
 	
115
 	
116
-	[nvc setViewControllers:@[newRoot] animated:newRoot.options.animations.push.enabled];
116
+	[nvc setViewControllers:@[newRoot] animated:newRoot.options.animations.push.enable];
117
 	
117
 	
118
 	[CATransaction commit];
118
 	[CATransaction commit];
119
 }
119
 }

+ 1
- 1
lib/ios/RNNScreenTransition.h 查看文件

7
 @property (nonatomic, strong) RNNTransitionStateHolder* content;
7
 @property (nonatomic, strong) RNNTransitionStateHolder* content;
8
 @property (nonatomic, strong) RNNTransitionStateHolder* bottomTabs;
8
 @property (nonatomic, strong) RNNTransitionStateHolder* bottomTabs;
9
 
9
 
10
-@property (nonatomic) BOOL enabled;
10
+@property (nonatomic) BOOL enable;
11
 
11
 
12
 - (BOOL)hasCustomAnimation;
12
 - (BOOL)hasCustomAnimation;
13
 
13
 

+ 1
- 1
lib/ios/RNNScreenTransition.m 查看文件

9
 	self.content = dict[@"content"] ? [[RNNTransitionStateHolder alloc] initWithDict:dict[@"content"]] : nil;
9
 	self.content = dict[@"content"] ? [[RNNTransitionStateHolder alloc] initWithDict:dict[@"content"]] : nil;
10
 	self.bottomTabs = dict[@"bottomTabs"] ? [[RNNTransitionStateHolder alloc] initWithDict:dict[@"bottomTabs"]] : nil;
10
 	self.bottomTabs = dict[@"bottomTabs"] ? [[RNNTransitionStateHolder alloc] initWithDict:dict[@"bottomTabs"]] : nil;
11
 
11
 
12
-	self.enabled = dict[@"enabled"] ? [dict[@"enabled"] boolValue] : YES;
12
+	self.enable = dict[@"enabled"] ? [dict[@"enabled"] boolValue] : YES;
13
 
13
 
14
 	return self;
14
 	return self;
15
 }
15
 }

+ 1
- 1
playground/src/screens/WelcomeScreen.js 查看文件

304
         options: {
304
         options: {
305
           animations: {
305
           animations: {
306
             push: {
306
             push: {
307
-              enabled: false
307
+              enable: false
308
             }
308
             }
309
           }
309
           }
310
         }
310
         }