Skip to content

Commit 7c00b30

Browse files
committed
Modify transition parameter
Former-commit-id: 20d0f94
1 parent 6e8a8df commit 7c00b30

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

MVVMReactiveCocoa/View/BaseClass/MRCNavigationControllerStack.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ - (void)registerNavigationHooks {
142142
animationControllerForOperation:(UINavigationControllerOperation)operation
143143
fromViewController:(MRCViewController *)fromVC
144144
toViewController:(MRCViewController *)toVC {
145-
if (operation == UINavigationControllerOperationPop) {
145+
if (fromVC.interactivePopTransition != nil) {
146146
return [[MRCViewControllerAnimatedTransition alloc] initWithNavigationControllerOperation:operation
147147
fromViewController:fromVC
148148
toViewController:toVC];

MVVMReactiveCocoa/View/BaseClass/MRCViewController.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ - (void)viewWillDisappear:(BOOL)animated {
148148
if ([self isMovingFromParentViewController]) {
149149
self.snapshot = [self.navigationController.view snapshotViewAfterScreenUpdates:NO];
150150
}
151-
151+
152152
// NSLog(@"isMovingToParentViewController: %@", @([self isMovingToParentViewController]));
153153
// NSLog(@"isMovingFromParentViewController: %@", @([self isMovingFromParentViewController]));
154154
}
@@ -175,13 +175,12 @@ - (void)handlePopRecognizer:(UIScreenEdgePanGestureRecognizer *)recognizer {
175175
// Create a interactive transition and pop the view controller
176176
self.interactivePopTransition = [[UIPercentDrivenInteractiveTransition alloc] init];
177177
[self.navigationController popViewControllerAnimated:YES];
178-
// [self.viewModel.services popViewModelAnimated:YES];
179178
} else if (recognizer.state == UIGestureRecognizerStateChanged) {
180179
// Update the interactive transition's progress
181180
[self.interactivePopTransition updateInteractiveTransition:progress];
182181
} else if (recognizer.state == UIGestureRecognizerStateEnded || recognizer.state == UIGestureRecognizerStateCancelled) {
183182
// Finish or cancel the interactive transition
184-
if (progress > 0.3) {
183+
if (progress > 0.25) {
185184
[self.interactivePopTransition finishInteractiveTransition];
186185
} else {
187186
[self.interactivePopTransition cancelInteractiveTransition];

MVVMReactiveCocoa/View/Transition/MRCViewControllerAnimatedTransition.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ - (instancetype)initWithNavigationControllerOperation:(UINavigationControllerOpe
3131
}
3232

3333
- (NSTimeInterval)transitionDuration:(id<UIViewControllerContextTransitioning>)transitionContext {
34-
return 0.25;
34+
return 0.5;
3535
}
3636

3737
- (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext {
@@ -82,7 +82,7 @@ - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionCo
8282
[[transitionContext containerView] addSubview:toViewController.snapshot];
8383
[[transitionContext containerView] sendSubviewToBack:toViewController.snapshot];
8484

85-
toViewController.snapshot.transform = CGAffineTransformMakeScale(0.97, 0.97);
85+
toViewController.snapshot.transform = CGAffineTransformMakeScale(0.95, 0.95);
8686

8787
[fromViewController.view addSubview:fromViewController.snapshot];
8888

0 commit comments

Comments
 (0)