You have to use Cusotm UIViewControllerAnimation
class to achieve this.Use the above code .CreateTransparentTransition.h and .m File
#import <Foundation/Foundation.h>
@interface TransparentTransition :NSObject<UIViewControllerAnimatedTransitioning,UIViewControllerTransitioningDelegate>{
BOOL isPresenting;
}
@end
//TransparentTransition.m
#import "TransparentTransition.h"
@implementation TransparentTransition
- (NSTimeInterval)transitionDuration:(id <UIViewControllerContextTransitioning>)transitionContext{
return 0.8f;
}
- (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionContext{
UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
UIView *toView = toVC.view;
UIView *fromView = fromVC.view;
UIView* containerView = [transitionContext containerView];
// Position the presented view off the top of the container view
if(isPresenting){
[containerView addSubview:toView];
toView.frame = CGRectMake(0, -toView.frame.size.height, toView.frame.size.width, toView.frame.size.height);
[UIView animateWithDuration:[self transitionDuration:transitionContext]
delay:0
usingSpringWithDamping:.8
initialSpringVelocity:6.0
options:0
animations:^{
toView.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"black_patch.png"]];
CGAffineTransform scaleTrans = CGAffineTransformMakeScale(1.0f, 1.0f);
CGAffineTransform lefttorightTrans = CGAffineTransformMakeTranslation(0.f,+toView.frame.size.height);
toView.transform = CGAffineTransformConcat(scaleTrans, lefttorightTrans);
}
completion:^(BOOL finished){
[transitionContext completeTransition:YES];
}];
}
else{
[UIView animateWithDuration:[self transitionDuration:transitionContext]
delay:0
options:0
animations:^{
// toView.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"black_patch.png"]];
CGAffineTransform scaleTrans = CGAffineTransformMakeScale(1.0f, 1.0f);
CGAffineTransform lefttorightTrans = CGAffineTransformMakeTranslation(0,-fromView.frame.size.height);
fromView.transform = CGAffineTransformConcat(scaleTrans, lefttorightTrans);
}
completion:^(BOOL finished){
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
}];
}
}
- (id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source{
isPresenting=YES;
return self;
}
- (id <UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed{
isPresenting=NO;
return self;
}
- (UIDynamicAnimator*)animateForTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext {
// Has to be implemented by subclasses
return nil;
}
//Usage of Above Animation
var transitionManager:TransparentTransition
@IBAction func signIn(sender: AnyObject) {
let detail = self.storyboard?.instantiateViewControllerWithIdentifier("detail") as! DetailViewController
detail.modalPresentationStyle = UIModalPresentationStyle.Custom;
detail.transitioningDelegate = transitionManager;
self.presentViewControllerdetail, animated: true, completion: nil)
}
Also here is nice tutorial which explains how to make such cool animation
http://www.appcoda.com/custom-view-controller-transitions-tutorial/