Skip to content

Commit

Permalink
Ensure that interactive transitions are never 100% completed
Browse files Browse the repository at this point in the history
With is a workaround for #4
  • Loading branch information
ColinEberhardt committed Oct 1, 2013
1 parent d253354 commit fa17dfe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ - (void)handleGesture:(UIPanGestureRecognizer*)gestureRecognizer {
fraction = fminf(fmaxf(fraction, 0.0), 1.0);
_shouldCompleteTransition = (fraction > 0.5);

// if an interactive transitions is 100% completed via the user interaction, for some reason
// the animation completion block is not called, and hence the transition is not completed.
// This glorious hack makes sure that this doesn't happen.
// see: https://github.com/ColinEberhardt/VCTransitionsLibrary/issues/4
if (fraction >= 1.0)
fraction = 0.99;

[self updateInteractiveTransition:fraction];
}
break;
Expand Down
7 changes: 7 additions & 0 deletions InteractionControllers/CEVerticalSwipeInteractionController.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ - (void)handleGesture:(UIPanGestureRecognizer*)gestureRecognizer {
fraction = fminf(fmaxf(fraction, 0.0), 1.0);
_shouldCompleteTransition = (fraction > 0.5);

// if an interactive transitions is 100% completed via the user interaction, for some reason
// the animation completion block is not called, and hence the transition is not completed.
// This glorious hack makes sure that this doesn't happen.
// see: https://github.com/ColinEberhardt/VCTransitionsLibrary/issues/4
if (fraction >= 1.0)
fraction = 0.99;

[self updateInteractiveTransition:fraction];
}
break;
Expand Down

0 comments on commit fa17dfe

Please sign in to comment.