Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions Transition Delegate/AnimatedTransitioning.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
//

#import "AnimatedTransitioning.h"
#import "MainViewController.h"
#import "SecondViewController.h"

@implementation AnimatedTransitioning

Expand All @@ -23,15 +21,15 @@ - (NSTimeInterval)transitionDuration:(id <UIViewControllerContextTransitioning>)
- (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionContext {

UIView *inView = [transitionContext containerView];
SecondViewController *toVC = (SecondViewController *)[transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
MainViewController *fromVC = (MainViewController *)[transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];

[inView addSubview:toVC.view];

CGRect screenRect = [[UIScreen mainScreen] bounds];
[toVC.view setFrame:CGRectMake(0, screenRect.size.height, fromVC.view.frame.size.width, fromVC.view.frame.size.height)];

[UIView animateWithDuration:0.25f
[UIView animateWithDuration:[self transitionDuration:transitionContext]
animations:^{

[toVC.view setFrame:CGRectMake(0, 0, fromVC.view.frame.size.width, fromVC.view.frame.size.height)];
Expand Down