Browse Source

fix ios test

Daniel Zlotin 7 years ago
parent
commit
829017db6f

+ 1
- 1
lib/ios/RNNAnimator.m View File

147
 {
147
 {
148
 	UIViewController* toVC   = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
148
 	UIViewController* toVC   = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
149
 	UIViewController* fromVC  = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
149
 	UIViewController* fromVC  = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
150
-	UIView* componentView = [transitionContext componentView];
150
+	UIView* componentView = [transitionContext containerView];
151
 	self.fromVC = fromVC;
151
 	self.fromVC = fromVC;
152
 	self.toVC = toVC;
152
 	self.toVC = toVC;
153
 	toVC.view.frame = fromVC.view.frame;
153
 	toVC.view.frame = fromVC.view.frame;

+ 7
- 7
lib/ios/RNNInteractivePopAnimator.m View File

90
 	return YES;
90
 	return YES;
91
 }
91
 }
92
 - (void)animationEnded:(BOOL)transitionCompleted {
92
 - (void)animationEnded:(BOOL)transitionCompleted {
93
-	
93
+
94
 }
94
 }
95
 
95
 
96
 - (NSTimeInterval)transitionDuration:(id <UIViewControllerContextTransitioning>)transitionContext
96
 - (NSTimeInterval)transitionDuration:(id <UIViewControllerContextTransitioning>)transitionContext
104
 	self.transitionContext = transitionContext;
104
 	self.transitionContext = transitionContext;
105
 	UIViewController* toVC   = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
105
 	UIViewController* toVC   = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
106
 	UIViewController* fromVC  = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
106
 	UIViewController* fromVC  = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
107
-	UIView* componentView = [transitionContext componentView];
108
-	
107
+	UIView* componentView = [transitionContext containerView];
108
+
109
 	toVC.view.frame = fromVC.view.frame;
109
 	toVC.view.frame = fromVC.view.frame;
110
 	UIView* topViewContent = [self.topView subviews][0];
110
 	UIView* topViewContent = [self.topView subviews][0];
111
 	UIImage* image = [[self.topView subviews][0] image];
111
 	UIImage* image = [[self.topView subviews][0] image];
143
 								  if (![transitionContext transitionWasCancelled]) {
143
 								  if (![transitionContext transitionWasCancelled]) {
144
 									  [componentView addSubview: toVC.view];
144
 									  [componentView addSubview: toVC.view];
145
 									  [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
145
 									  [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
146
-									  
146
+
147
 								  }
147
 								  }
148
 								  if ([transitionContext transitionWasCancelled]) {
148
 								  if ([transitionContext transitionWasCancelled]) {
149
 									  [self.topView setHidden:NO];
149
 									  [self.topView setHidden:NO];
157
 								  animationControllerForOperation:(UINavigationControllerOperation)operation
157
 								  animationControllerForOperation:(UINavigationControllerOperation)operation
158
 											   fromViewController:(UIViewController*)fromVC
158
 											   fromViewController:(UIViewController*)fromVC
159
 												 toViewController:(UIViewController*)toVC {
159
 												 toViewController:(UIViewController*)toVC {
160
-	
160
+
161
 		if (operation == UINavigationControllerOperationPop) {
161
 		if (operation == UINavigationControllerOperationPop) {
162
 			return self;
162
 			return self;
163
 		} else {
163
 		} else {
164
 			return nil;
164
 			return nil;
165
 		}
165
 		}
166
-	
166
+
167
 	return nil;
167
 	return nil;
168
-	
168
+
169
 }
169
 }
170
 - (id<UIViewControllerInteractiveTransitioning>)navigationController:(UINavigationController *)navigationController
170
 - (id<UIViewControllerInteractiveTransitioning>)navigationController:(UINavigationController *)navigationController
171
 						 interactionControllerForAnimationController:(id<UIViewControllerAnimatedTransitioning>)animationController {
171
 						 interactionControllerForAnimationController:(id<UIViewControllerAnimatedTransitioning>)animationController {

+ 3
- 3
lib/ios/ReactNativeNavigationTests/RNNControllerFactoryTest.m View File

46
 - (void)testCreateLayout_ComponentStackLayout {
46
 - (void)testCreateLayout_ComponentStackLayout {
47
 	id ans = [self.factory createLayoutAndSaveToStore:
47
 	id ans = [self.factory createLayoutAndSaveToStore:
48
 			  @{@"id": @"cntId",
48
 			  @{@"id": @"cntId",
49
-				@"type": @"ComponentStack",
49
+				@"type": @"Stack",
50
 				@"data": @{},
50
 				@"data": @{},
51
 				@"children": @[]}];
51
 				@"children": @[]}];
52
 	XCTAssertTrue([ans isMemberOfClass:[RNNNavigationController class]]);
52
 	XCTAssertTrue([ans isMemberOfClass:[RNNNavigationController class]]);
55
 - (void)testCreateLayout_ComponentStackLayoutRecursive {
55
 - (void)testCreateLayout_ComponentStackLayoutRecursive {
56
 	RNNNavigationController* ans = (RNNNavigationController*) [self.factory createLayoutAndSaveToStore:
56
 	RNNNavigationController* ans = (RNNNavigationController*) [self.factory createLayoutAndSaveToStore:
57
 															 @{@"id": @"cntId",
57
 															 @{@"id": @"cntId",
58
-															   @"type": @"ComponentStack",
58
+															   @"type": @"Stack",
59
 															   @"data": @{},
59
 															   @"data": @{},
60
 															   @"children": @[
60
 															   @"children": @[
61
 																	   @{@"id": @"cntId_2",
61
 																	   @{@"id": @"cntId_2",
76
 														  @"data": @{},
76
 														  @"data": @{},
77
 														  @"children": @[
77
 														  @"children": @[
78
 																  @{@"id": @"cntId_2",
78
 																  @{@"id": @"cntId_2",
79
-																	@"type": @"ComponentStack",
79
+																	@"type": @"Stack",
80
 																	@"data": @{},
80
 																	@"data": @{},
81
 																	@"children": @[
81
 																	@"children": @[
82
 																			@{@"id": @"cntId_3",
82
 																			@{@"id": @"cntId_3",