Skip to content
This repository has been archived by the owner on Nov 13, 2017. It is now read-only.

Commit

Permalink
Merge pull request #1 from stefz/master
Browse files Browse the repository at this point in the history
Fixed bug when a transition is cancelled
  • Loading branch information
m4tbat committed Dec 15, 2014
2 parents 321329c + bd20fbe commit 034f1cc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
Empty file removed Pod/Classes/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion Pod/Classes/Animators/MBTXYAnimator.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ - (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionC
toView.frame = finalToFrame;
}
completion:^(BOOL finished) {
if (!finished) {
if ([transitionContext transitionWasCancelled]) {
fromView.frame = initialFromFrame;
toView.frame = initialToFrame;
}
Expand Down
6 changes: 3 additions & 3 deletions Pod/Classes/Animators/MBTZAnimator.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionCo
options:0
animations:^{
fromView.transform = CGAffineTransformMakeScale(scaleFromX, scaleFromY);
fromView.alpha = 0;
fromView.alpha = 0.0;
toView.transform = CGAffineTransformIdentity;
toView.alpha = 1;
toView.alpha = 1.0;
}
completion:^(BOOL finished) {
if (!finished) {
fromView.transform = CGAffineTransformIdentity;
fromView.alpha = 1;
fromView.alpha = 1.0;
}

[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
Expand Down
5 changes: 0 additions & 5 deletions Pod/Classes/MBT3DGridViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ typedef NS_ENUM(NSInteger, MBT3DGridTransitionDirection) {

@property (weak, nonatomic) IBOutlet UIView *backgroundView;

/**
* <#Description#>
*
* @param direction <#direction description#>
*/
- (BOOL)moveAlongDirection:(MBT3DGridTransitionDirection)direction interactively:(BOOL)interactively;

@end
Expand Down
1 change: 1 addition & 0 deletions Pod/Classes/MBT3DGridViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ - (void)viewDidLoad {
[self addChildViewController:self.currentContentViewController];
[self.currentContentViewController beginAppearanceTransition:YES animated:NO];
[self.view addSubview:self.currentContentViewController.view];

[self.currentContentViewController didMoveToParentViewController:self];
[self.currentContentViewController endAppearanceTransition];
}
Expand Down

0 comments on commit 034f1cc

Please sign in to comment.