├── .gitignore ├── AnimationControllers ├── CECardsAnimationController.h ├── CECardsAnimationController.m ├── CECrossfadeAnimationController.h ├── CECrossfadeAnimationController.m ├── CECubeAnimationController.h ├── CECubeAnimationController.m ├── CEExplodeAnimationController.h ├── CEExplodeAnimationController.m ├── CEFlipAnimationController.h ├── CEFlipAnimationController.m ├── CEFoldAnimationController.h ├── CEFoldAnimationController.m ├── CENatGeoAnimationController.h ├── CENatGeoAnimationController.m ├── CEPanAnimationController.h ├── CEPanAnimationController.m ├── CEPortalAnimationController.h ├── CEPortalAnimationController.m ├── CEReversibleAnimationController.h ├── CEReversibleAnimationController.m ├── CETurnAnimationController.h └── CETurnAnimationController.m ├── CHANGELOG.md ├── InteractionControllers ├── CEBaseInteractionController.h ├── CEBaseInteractionController.m ├── CEHorizontalSwipeInteractionController.h ├── CEHorizontalSwipeInteractionController.m ├── CEPinchInteractionController.h ├── CEPinchInteractionController.m ├── CEVerticalSwipeInteractionController.h └── CEVerticalSwipeInteractionController.m ├── MIT-LICENSE.txt ├── README.md ├── Screenshots ├── Cards │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png ├── Crossfade │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png ├── Cube │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png ├── Explode │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png ├── Flip │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png ├── Fold │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png ├── NatGeo │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png ├── Pan │ ├── pan_1.png │ ├── pan_2.png │ └── pan_3.png ├── Portal │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png ├── Turn │ ├── 1.png │ ├── 1a.png │ ├── 2.png │ ├── 2a.png │ ├── 3.png │ ├── 3a.png │ ├── 4.png │ └── 4a.png └── thumbnails │ ├── Cards │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png │ ├── Crossfade │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png │ ├── Cube │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png │ ├── Explode │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png │ ├── Flip │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png │ ├── Fold │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png │ ├── NatGeo │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png │ ├── Pan │ ├── pan_1.png │ └── pan_2.png │ ├── Portal │ ├── 1.png │ ├── 2.png │ ├── 3.png │ └── 4.png │ └── Turn │ ├── 1.png │ ├── 1a.png │ ├── 2.png │ ├── 2a.png │ ├── 3.png │ ├── 3a.png │ ├── 4.png │ └── 4a.png ├── TabBarDemo ├── TabBarDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── TabBarDemo.xccheckout ├── TabBarDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── Main_iPad.storyboard │ │ └── Main_iPhone.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── TabBarDemo-Info.plist │ ├── TabBarDemo-Prefix.pch │ ├── TabBarViewController.h │ ├── TabBarViewController.m │ ├── ViewController.h │ ├── ViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── TabBarDemoTests │ ├── TabBarDemoTests-Info.plist │ ├── TabBarDemoTests.m │ └── en.lproj │ └── InfoPlist.strings ├── TransitionsDemo ├── TransitionsDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── TransitionsDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ ├── Launch Screen.storyboard │ └── Main_iPhone.storyboard │ ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json │ ├── NavigationController.h │ ├── NavigationController.m │ ├── SettingsViewController.h │ ├── SettingsViewController.m │ ├── TransitionsDemo-Info.plist │ ├── TransitionsDemo-Prefix.pch │ ├── ViewController.h │ ├── ViewController.m │ ├── en.lproj │ └── InfoPlist.strings │ └── main.m └── VCTransitionsLibrary.podspec /.gitignore: -------------------------------------------------------------------------------- 1 | ######################### 2 | # .gitignore file for Xcode4 / OS X Source projects 3 | # 4 | # Version 2.0 5 | # For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects 6 | # 7 | # 2013 updates: 8 | # - fixed the broken "save personal Schemes" 9 | # 10 | # NB: if you are storing "built" products, this WILL NOT WORK, 11 | # and you should use a different .gitignore (or none at all) 12 | # This file is for SOURCE projects, where there are many extra 13 | # files that we want to exclude 14 | # 15 | ######################### 16 | 17 | ##### 18 | # OS X temporary files that should never be committed 19 | 20 | .DS_Store 21 | *.swp 22 | *.lock 23 | profile 24 | 25 | 26 | #### 27 | # Xcode temporary files that should never be committed 28 | # 29 | # NB: NIB/XIB files still exist even on Storyboard projects, so we want this... 30 | 31 | *~.nib 32 | 33 | 34 | #### 35 | # Xcode build files - 36 | # 37 | # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData" 38 | 39 | DerivedData/ 40 | 41 | # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build" 42 | 43 | build/ 44 | 45 | 46 | ##### 47 | # Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups) 48 | # 49 | # This is complicated: 50 | # 51 | # SOMETIMES you need to put this file in version control. 52 | # Apple designed it poorly - if you use "custom executables", they are 53 | # saved in this file. 54 | # 99% of projects do NOT use those, so they do NOT want to version control this file. 55 | # ..but if you're in the 1%, comment out the line "*.pbxuser" 56 | 57 | *.pbxuser 58 | *.mode1v3 59 | *.mode2v3 60 | *.perspectivev3 61 | # NB: also, whitelist the default ones, some projects need to use these 62 | !default.pbxuser 63 | !default.mode1v3 64 | !default.mode2v3 65 | !default.perspectivev3 66 | 67 | 68 | #### 69 | # Xcode 4 - semi-personal settings 70 | # 71 | # 72 | # OPTION 1: --------------------------------- 73 | # throw away ALL personal settings (including custom schemes! 74 | # - unless they are "shared") 75 | # 76 | # NB: this is exclusive with OPTION 2 below 77 | xcuserdata 78 | 79 | # OPTION 2: --------------------------------- 80 | # get rid of ALL personal settings, but KEEP SOME OF THEM 81 | # - NB: you must manually uncomment the bits you want to keep 82 | # 83 | # NB: this is exclusive with OPTION 1 above 84 | # 85 | #xcuserdata/**/* 86 | 87 | # (requires option 2 above): Personal Schemes 88 | # 89 | #!xcuserdata/**/xcschemes/* 90 | 91 | #### 92 | # XCode 4 workspaces - more detailed 93 | # 94 | # Workspaces are important! They are a core feature of Xcode - don't exclude them :) 95 | # 96 | # Workspace layout is quite spammy. For reference: 97 | # 98 | # /(root)/ 99 | # /(project-name).xcodeproj/ 100 | # project.pbxproj 101 | # /project.xcworkspace/ 102 | # contents.xcworkspacedata 103 | # /xcuserdata/ 104 | # /(your name)/xcuserdatad/ 105 | # UserInterfaceState.xcuserstate 106 | # /xcsshareddata/ 107 | # /xcschemes/ 108 | # (shared scheme name).xcscheme 109 | # /xcuserdata/ 110 | # /(your name)/xcuserdatad/ 111 | # (private scheme).xcscheme 112 | # xcschememanagement.plist 113 | # 114 | # 115 | 116 | #### 117 | # Xcode 4 - Deprecated classes 118 | # 119 | # Allegedly, if you manually "deprecate" your classes, they get moved here. 120 | # 121 | # We're using source-control, so this is a "feature" that we do not want! 122 | 123 | *.moved-aside 124 | 125 | #### 126 | # Cocoapods: cocoapods.org 127 | # 128 | # Ignoring these files means that whoever uses the code will first have to run: 129 | # pod install 130 | # in the App.xcodeproj directory. 131 | # This ensures the latest dependencies are used. 132 | Pods/ 133 | Podfile.lock 134 | 135 | 136 | #### 137 | # UNKNOWN: recommended by others, but I can't discover what these files are 138 | # 139 | # ...none. Everything is now explained. 140 | TransitionsDemo.xccheckout 141 | -------------------------------------------------------------------------------- /AnimationControllers/CECardsAnimationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CEZoomAnimationController.h 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 22/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CEReversibleAnimationController.h" 10 | 11 | @interface CECardsAnimationController : CEReversibleAnimationController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /AnimationControllers/CECardsAnimationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CEZoomAnimationController.m 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 22/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CECardsAnimationController.h" 10 | 11 | @implementation CECardsAnimationController 12 | 13 | 14 | 15 | - (void)animateTransition:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView { 16 | 17 | if(self.reverse){ 18 | [self executeReverseAnimation:transitionContext fromVC:fromVC toVC:toVC fromView:fromView toView:toView]; 19 | } else { 20 | [self executeForwardsAnimation:transitionContext fromVC:fromVC toVC:toVC fromView:fromView toView:toView]; 21 | } 22 | 23 | } 24 | 25 | -(void)executeForwardsAnimation:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView { 26 | 27 | UIView* containerView = [transitionContext containerView]; 28 | 29 | // positions the to- view off the bottom of the sceen 30 | CGRect frame = [transitionContext initialFrameForViewController:fromVC]; 31 | CGRect offScreenFrame = frame; 32 | offScreenFrame.origin.y = offScreenFrame.size.height; 33 | toView.frame = offScreenFrame; 34 | 35 | [containerView insertSubview:toView aboveSubview:fromView]; 36 | 37 | CATransform3D t1 = [self firstTransform]; 38 | CATransform3D t2 = [self secondTransformWithView:fromView]; 39 | 40 | [UIView animateKeyframesWithDuration:self.duration delay:0.0 options:UIViewKeyframeAnimationOptionCalculationModeCubic animations:^{ 41 | 42 | // push the from- view to the back 43 | [UIView addKeyframeWithRelativeStartTime:0.0f relativeDuration:0.4f animations:^{ 44 | fromView.layer.transform = t1; 45 | fromView.alpha = 0.6; 46 | }]; 47 | [UIView addKeyframeWithRelativeStartTime:0.2f relativeDuration:0.4f animations:^{ 48 | fromView.layer.transform = t2; 49 | }]; 50 | 51 | // slide the to- view upwards. In his original implementation Tope used a 'spring' animation, however 52 | // this does not work with keyframes, so we siulate it by overshooting the final location in 53 | // the first keyframe 54 | [UIView addKeyframeWithRelativeStartTime:0.6f relativeDuration:0.2f animations:^{ 55 | toView.frame = CGRectOffset(toView.frame, 0.0, -30.0); 56 | }]; 57 | [UIView addKeyframeWithRelativeStartTime:0.8f relativeDuration:0.2f animations:^{ 58 | toView.frame = frame; 59 | }]; 60 | 61 | } completion:^(BOOL finished) { 62 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 63 | }]; 64 | 65 | 66 | } 67 | 68 | -(void)executeReverseAnimation:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView { 69 | 70 | UIView* containerView = [transitionContext containerView]; 71 | 72 | // positions the to- view behind the from- view 73 | CGRect frame = [transitionContext initialFrameForViewController:fromVC]; 74 | toView.frame = frame; 75 | CATransform3D scale = CATransform3DIdentity; 76 | toView.layer.transform = CATransform3DScale(scale, 0.6, 0.6, 1); 77 | toView.alpha = 0.6; 78 | 79 | [containerView insertSubview:toView belowSubview:fromView]; 80 | 81 | CGRect frameOffScreen = frame; 82 | frameOffScreen.origin.y = frame.size.height; 83 | 84 | CATransform3D t1 = [self firstTransform]; 85 | 86 | [UIView animateKeyframesWithDuration:self.duration delay:0 options:UIViewKeyframeAnimationOptionCalculationModeCubic animations:^{ 87 | 88 | // push the from- view off the bottom of the screen 89 | [UIView addKeyframeWithRelativeStartTime:0.0f relativeDuration:0.5f animations:^{ 90 | fromView.frame = frameOffScreen; 91 | }]; 92 | 93 | // animate the to- view into place 94 | [UIView addKeyframeWithRelativeStartTime:0.35f relativeDuration:0.35f animations:^{ 95 | toView.layer.transform = t1; 96 | toView.alpha = 1.0; 97 | }]; 98 | [UIView addKeyframeWithRelativeStartTime:0.75f relativeDuration:0.25f animations:^{ 99 | toView.layer.transform = CATransform3DIdentity; 100 | }]; 101 | } completion:^(BOOL finished) { 102 | if ([transitionContext transitionWasCancelled]) { 103 | toView.layer.transform = CATransform3DIdentity; 104 | toView.alpha = 1.0; 105 | } 106 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 107 | }]; 108 | } 109 | 110 | -(CATransform3D)firstTransform{ 111 | CATransform3D t1 = CATransform3DIdentity; 112 | t1.m34 = 1.0/-900; 113 | t1 = CATransform3DScale(t1, 0.95, 0.95, 1); 114 | t1 = CATransform3DRotate(t1, 15.0f * M_PI/180.0f, 1, 0, 0); 115 | return t1; 116 | 117 | } 118 | 119 | -(CATransform3D)secondTransformWithView:(UIView*)view{ 120 | 121 | CATransform3D t2 = CATransform3DIdentity; 122 | t2.m34 = [self firstTransform].m34; 123 | t2 = CATransform3DTranslate(t2, 0, view.frame.size.height*-0.08, 0); 124 | t2 = CATransform3DScale(t2, 0.8, 0.8, 1); 125 | 126 | return t2; 127 | } 128 | 129 | @end 130 | -------------------------------------------------------------------------------- /AnimationControllers/CECrossfadeAnimationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CECrossfadeAnimationController.h 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 11/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CEReversibleAnimationController.h" 10 | 11 | /** 12 | Animates between the two view controllers by performing a simple cross-fade. 13 | */ 14 | @interface CECrossfadeAnimationController : CEReversibleAnimationController 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AnimationControllers/CECrossfadeAnimationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CECrossfadeAnimationController.m 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 11/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CECrossfadeAnimationController.h" 10 | 11 | @implementation CECrossfadeAnimationController 12 | 13 | - (void)animateTransition:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView { 14 | 15 | // Add the toView to the container 16 | UIView* containerView = [transitionContext containerView]; 17 | toView.frame = [transitionContext finalFrameForViewController:toVC]; 18 | [containerView addSubview:toView]; 19 | [containerView sendSubviewToBack:toView]; 20 | 21 | // animate 22 | NSTimeInterval duration = [self transitionDuration:transitionContext]; 23 | [UIView animateWithDuration:duration animations:^{ 24 | fromView.alpha = 0.0; 25 | } completion:^(BOOL finished) { 26 | if ([transitionContext transitionWasCancelled]) { 27 | fromView.alpha = 1.0; 28 | } else { 29 | // reset from- view to its original state 30 | [fromView removeFromSuperview]; 31 | fromView.alpha = 1.0; 32 | } 33 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 34 | }]; 35 | 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /AnimationControllers/CECubeAnimationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CubeNavigationAnimator.h 3 | // MovieQuiz 4 | // 5 | // Created by Andrés Brun on 27/10/13. 6 | // Copyright (c) 2013 Andrés Brun. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CEReversibleAnimationController.h" 11 | 12 | typedef enum {CubeAnimationWayHorizontal, CubeAnimationWayVertical} CubeAnimationWay; 13 | typedef enum {CubeAnimationTypeInverse, CubeAnimationTypeNormal} CubeAnimationType; 14 | 15 | @interface CECubeAnimationController : CEReversibleAnimationController 16 | 17 | @property (nonatomic, assign) CubeAnimationWay cubeAnimationWay; 18 | @property (nonatomic, assign) CubeAnimationType cubeAnimationType; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /AnimationControllers/CECubeAnimationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CubeNavigationAnimator.m 3 | // MovieQuiz 4 | // 5 | // Created by Andrés Brun on 27/10/13. 6 | // Copyright (c) 2013 Andrés Brun. All rights reserved. 7 | // 8 | 9 | #import "CECubeAnimationController.h" 10 | 11 | #define PERSPECTIVE -1.0 / 200.0 12 | #define ROTATION_ANGLE M_PI_2 13 | 14 | @implementation CECubeAnimationController 15 | 16 | - (id)init 17 | { 18 | self = [super init]; 19 | if (self) { 20 | self.cubeAnimationWay = CubeAnimationWayHorizontal; 21 | } 22 | return self; 23 | } 24 | 25 | - (void)animateTransition:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView 26 | { 27 | toView.frame = [transitionContext finalFrameForViewController:toVC]; 28 | 29 | //Calculate the direction 30 | int dir = self.reverse ? 1 : -1; 31 | 32 | //Create the differents 3D animations 33 | CATransform3D viewFromTransform; 34 | CATransform3D viewToTransform; 35 | 36 | //We create a content view for do the translate animation 37 | UIView *generalContentView = [transitionContext containerView]; 38 | 39 | switch (self.cubeAnimationWay) { 40 | case CubeAnimationWayHorizontal: 41 | viewFromTransform = CATransform3DMakeRotation(dir*ROTATION_ANGLE, 0.0, 1.0, 0.0); 42 | viewToTransform = CATransform3DMakeRotation(-dir*ROTATION_ANGLE, 0.0, 1.0, 0.0); 43 | [toView.layer setAnchorPoint:CGPointMake(dir==1?0:1, 0.5)]; 44 | [fromView.layer setAnchorPoint:CGPointMake(dir==1?1:0, 0.5)]; 45 | 46 | [generalContentView setTransform:CGAffineTransformMakeTranslation(dir*(generalContentView.frame.size.width)/2.0, 0)]; 47 | break; 48 | 49 | case CubeAnimationWayVertical: 50 | viewFromTransform = CATransform3DMakeRotation(-dir*ROTATION_ANGLE, 1.0, 0.0, 0.0); 51 | viewToTransform = CATransform3DMakeRotation(dir*ROTATION_ANGLE, 1.0, 0.0, 0.0); 52 | [toView.layer setAnchorPoint:CGPointMake(0.5, dir==1?0:1)]; 53 | [fromView.layer setAnchorPoint:CGPointMake(0.5, dir==1?1:0)]; 54 | 55 | [generalContentView setTransform:CGAffineTransformMakeTranslation(0, dir*(generalContentView.frame.size.height)/2.0)]; 56 | break; 57 | 58 | default: 59 | break; 60 | } 61 | 62 | viewFromTransform.m34 = PERSPECTIVE; 63 | viewToTransform.m34 = PERSPECTIVE; 64 | 65 | toView.layer.transform = viewToTransform; 66 | 67 | //Create the shadow 68 | UIView *fromShadow = [self addOpacityToView:fromView withColor:[UIColor blackColor]]; 69 | UIView *toShadow = [self addOpacityToView:toView withColor:[UIColor blackColor]]; 70 | [fromShadow setAlpha:0.0]; 71 | [toShadow setAlpha:1.0]; 72 | 73 | //Add the to- view 74 | [generalContentView addSubview:toView]; 75 | 76 | [UIView animateWithDuration:[self transitionDuration:transitionContext] animations:^{ 77 | switch (self.cubeAnimationWay) { 78 | case CubeAnimationWayHorizontal: 79 | [generalContentView setTransform:CGAffineTransformMakeTranslation(-dir*generalContentView.frame.size.width/2.0, 0)]; 80 | break; 81 | 82 | case CubeAnimationWayVertical: 83 | [generalContentView setTransform:CGAffineTransformMakeTranslation(0, -dir*(generalContentView.frame.size.height)/2.0)]; 84 | break; 85 | 86 | default: 87 | break; 88 | } 89 | 90 | fromView.layer.transform = viewFromTransform; 91 | toView.layer.transform = CATransform3DIdentity; 92 | 93 | [fromShadow setAlpha:1.0]; 94 | [toShadow setAlpha:0.0]; 95 | 96 | } completion:^(BOOL finished) { 97 | 98 | //Set the final position of every elements transformed 99 | [generalContentView setTransform:CGAffineTransformIdentity]; 100 | fromView.layer.transform = CATransform3DIdentity; 101 | toView.layer.transform = CATransform3DIdentity; 102 | [fromView.layer setAnchorPoint:CGPointMake(0.5f, 0.5f)]; 103 | [toView.layer setAnchorPoint:CGPointMake(0.5f, 0.5f)]; 104 | 105 | [fromShadow removeFromSuperview]; 106 | [toShadow removeFromSuperview]; 107 | 108 | if ([transitionContext transitionWasCancelled]) { 109 | [toView removeFromSuperview]; 110 | } else { 111 | [fromView removeFromSuperview]; 112 | } 113 | 114 | // inform the context of completion 115 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 116 | 117 | }]; 118 | } 119 | 120 | - (UIView *)addOpacityToView:(UIView *) view withColor:(UIColor *)theColor 121 | { 122 | UIView *shadowView = [[UIView alloc] initWithFrame:view.bounds]; 123 | [shadowView setBackgroundColor:[theColor colorWithAlphaComponent:0.8]]; 124 | [view addSubview:shadowView]; 125 | return shadowView; 126 | } 127 | 128 | @end 129 | -------------------------------------------------------------------------------- /AnimationControllers/CEExplodeAnimationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CEExplodeAnimationController.h 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 11/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CEReversibleAnimationController.h" 10 | 11 | /** 12 | Animates between the two view controllers by slicing the from- view controller into lots of little pieces, then randomly spinning and shrinking them. 13 | */ 14 | @interface CEExplodeAnimationController : CEReversibleAnimationController 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AnimationControllers/CEExplodeAnimationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CEExplodeAnimationController.m 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 11/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CEExplodeAnimationController.h" 10 | 11 | @implementation CEExplodeAnimationController 12 | 13 | - (void)animateTransition:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView { 14 | 15 | // Add the toView to the container 16 | UIView* containerView = [transitionContext containerView]; 17 | [containerView addSubview:toView]; 18 | [containerView sendSubviewToBack:toView]; 19 | 20 | CGSize size = toView.frame.size; 21 | 22 | NSMutableArray *snapshots = [NSMutableArray new]; 23 | 24 | CGFloat xFactor = 10.0f; 25 | CGFloat yFactor = xFactor * size.height / size.width; 26 | 27 | // snapshot the from view, this makes subsequent snaphots more performant 28 | UIView *fromViewSnapshot = [fromView snapshotViewAfterScreenUpdates:NO]; 29 | 30 | // create a snapshot for each of the exploding pieces 31 | for (CGFloat x=0; x < size.width; x+= size.width / xFactor) { 32 | for (CGFloat y=0; y < size.height; y+= size.height / yFactor) { 33 | CGRect snapshotRegion = CGRectMake(x, y, size.width / xFactor, size.height / yFactor); 34 | UIView *snapshot = [fromViewSnapshot resizableSnapshotViewFromRect:snapshotRegion afterScreenUpdates:NO withCapInsets:UIEdgeInsetsZero]; 35 | snapshot.frame = snapshotRegion; 36 | [containerView addSubview:snapshot]; 37 | [snapshots addObject:snapshot]; 38 | } 39 | } 40 | 41 | [containerView sendSubviewToBack:fromView]; 42 | 43 | // animate 44 | NSTimeInterval duration = [self transitionDuration:transitionContext]; 45 | [UIView animateWithDuration:duration animations:^{ 46 | for (UIView *view in snapshots) { 47 | CGFloat xOffset = [self randomFloatBetween:-100.0 and:100.0]; 48 | CGFloat yOffset = [self randomFloatBetween:-100.0 and:100.0]; 49 | view.frame = CGRectOffset(view.frame, xOffset, yOffset); 50 | view.alpha = 0.0; 51 | view.transform = CGAffineTransformScale(CGAffineTransformMakeRotation([self randomFloatBetween:-10.0 and:10.0]), 0.01, 0.01); 52 | } 53 | } completion:^(BOOL finished) { 54 | for (UIView *view in snapshots) { 55 | [view removeFromSuperview]; 56 | } 57 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 58 | }]; 59 | 60 | } 61 | 62 | - (float)randomFloatBetween:(float)smallNumber and:(float)bigNumber { 63 | float diff = bigNumber - smallNumber; 64 | return (((float) (arc4random() % ((unsigned)RAND_MAX + 1)) / RAND_MAX) * diff) + smallNumber; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /AnimationControllers/CEFlipAnimationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CEFlipAnimationController.h 3 | // ViewControllerTransitions 4 | // 5 | // Created by Colin Eberhardt on 09/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CEReversibleAnimationController.h" 10 | 11 | /** 12 | Animates between the two view controllers using a page-flip transition. 13 | */ 14 | @interface CEFlipAnimationController : CEReversibleAnimationController 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AnimationControllers/CEFlipAnimationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CEFlipAnimationController.m 3 | // ViewControllerTransitions 4 | // 5 | // Created by Colin Eberhardt on 09/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CEFlipAnimationController.h" 10 | 11 | @implementation CEFlipAnimationController 12 | 13 | 14 | - (void)animateTransition:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView { 15 | 16 | // Add the toView to the container 17 | UIView* containerView = [transitionContext containerView]; 18 | [containerView addSubview:toView]; 19 | [containerView sendSubviewToBack:toView]; 20 | 21 | // Add a perspective transform 22 | CATransform3D transform = CATransform3DIdentity; 23 | transform.m34 = -0.002; 24 | [containerView.layer setSublayerTransform:transform]; 25 | 26 | // Give both VCs the same start frame 27 | CGRect initialFrame = [transitionContext initialFrameForViewController:fromVC]; 28 | fromView.frame = initialFrame; 29 | toView.frame = initialFrame; 30 | 31 | // create two-part snapshots of both the from- and to- views 32 | NSArray* toViewSnapshots = [self createSnapshots:toView afterScreenUpdates:YES]; 33 | UIView* flippedSectionOfToView = toViewSnapshots[self.reverse ? 0 : 1]; 34 | 35 | NSArray* fromViewSnapshots = [self createSnapshots:fromView afterScreenUpdates:NO]; 36 | UIView* flippedSectionOfFromView = fromViewSnapshots[self.reverse ? 1 : 0]; 37 | 38 | // replace the from- and to- views with container views that include gradients 39 | flippedSectionOfFromView = [self addShadowToView:flippedSectionOfFromView reverse:!self.reverse]; 40 | UIView* flippedSectionOfFromViewShadow = flippedSectionOfFromView.subviews[1]; 41 | flippedSectionOfFromViewShadow.alpha = 0.0; 42 | 43 | flippedSectionOfToView = [self addShadowToView:flippedSectionOfToView reverse:self.reverse]; 44 | UIView* flippedSectionOfToViewShadow = flippedSectionOfToView.subviews[1]; 45 | flippedSectionOfToViewShadow.alpha = 1.0; 46 | 47 | // change the anchor point so that the view rotate around the correct edge 48 | [self updateAnchorPointAndOffset:CGPointMake(self.reverse ? 0.0 : 1.0, 0.5) view:flippedSectionOfFromView]; 49 | [self updateAnchorPointAndOffset:CGPointMake(self.reverse ? 1.0 : 0.0, 0.5) view:flippedSectionOfToView]; 50 | 51 | // rotate the to- view by 90 degrees, hiding it 52 | flippedSectionOfToView.layer.transform = [self rotate:self.reverse ? M_PI_2 : -M_PI_2]; 53 | 54 | // animate 55 | NSTimeInterval duration = [self transitionDuration:transitionContext]; 56 | 57 | [UIView animateKeyframesWithDuration:duration 58 | delay:0.0 59 | options:0 60 | animations:^{ 61 | [UIView addKeyframeWithRelativeStartTime:0.0 62 | relativeDuration:0.5 63 | animations:^{ 64 | // rotate the from- view to 90 degrees 65 | flippedSectionOfFromView.layer.transform = [self rotate:self.reverse ? -M_PI_2 : M_PI_2]; 66 | flippedSectionOfFromViewShadow.alpha = 1.0; 67 | }]; 68 | [UIView addKeyframeWithRelativeStartTime:0.5 69 | relativeDuration:0.5 70 | animations:^{ 71 | // rotate the to- view to 0 degrees 72 | flippedSectionOfToView.layer.transform = [self rotate:self.reverse ? 0.001 : -0.001]; 73 | flippedSectionOfToViewShadow.alpha = 0.0; 74 | }]; 75 | } completion:^(BOOL finished) { 76 | 77 | // remove all the temporary views 78 | if ([transitionContext transitionWasCancelled]) { 79 | [self removeOtherViews:fromView]; 80 | } else { 81 | [self removeOtherViews:toView]; 82 | } 83 | 84 | // inform the context of completion 85 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 86 | }]; 87 | 88 | } 89 | 90 | // removes all the views other than the given view from the superview 91 | - (void)removeOtherViews:(UIView*)viewToKeep { 92 | UIView* containerView = viewToKeep.superview; 93 | for (UIView* view in containerView.subviews) { 94 | if (view != viewToKeep) { 95 | [view removeFromSuperview]; 96 | } 97 | } 98 | } 99 | 100 | // adds a gradient to an image by creating a containing UIView with both the given view 101 | // and the gradient as subviews 102 | - (UIView*)addShadowToView:(UIView*)view reverse:(BOOL)reverse { 103 | 104 | UIView* containerView = view.superview; 105 | 106 | // create a view with the same frame 107 | UIView* viewWithShadow = [[UIView alloc] initWithFrame:view.frame]; 108 | 109 | // replace the view that we are adding a shadow to 110 | [containerView insertSubview:viewWithShadow aboveSubview:view]; 111 | [view removeFromSuperview]; 112 | 113 | // create a shadow 114 | UIView* shadowView = [[UIView alloc] initWithFrame:viewWithShadow.bounds]; 115 | CAGradientLayer *gradient = [CAGradientLayer layer]; 116 | gradient.frame = shadowView.bounds; 117 | gradient.colors = @[(id)[UIColor colorWithWhite:0.0 alpha:0.0].CGColor, 118 | (id)[UIColor colorWithWhite:0.0 alpha:0.5].CGColor]; 119 | gradient.startPoint = CGPointMake(reverse ? 0.0 : 1.0, 0.0); 120 | gradient.endPoint = CGPointMake(reverse ? 1.0 : 0.0, 0.0); 121 | [shadowView.layer insertSublayer:gradient atIndex:1]; 122 | 123 | // add the original view into our new view 124 | view.frame = view.bounds; 125 | [viewWithShadow addSubview:view]; 126 | 127 | // place the shadow on top 128 | [viewWithShadow addSubview:shadowView]; 129 | 130 | return viewWithShadow; 131 | } 132 | 133 | // creates a pair of snapshots from the given view 134 | - (NSArray*)createSnapshots:(UIView*)view afterScreenUpdates:(BOOL) afterUpdates{ 135 | UIView* containerView = view.superview; 136 | 137 | // snapshot the left-hand side of the view 138 | CGRect snapshotRegion = CGRectMake(0, 0, view.frame.size.width / 2, view.frame.size.height); 139 | UIView *leftHandView = [view resizableSnapshotViewFromRect:snapshotRegion afterScreenUpdates:afterUpdates withCapInsets:UIEdgeInsetsZero]; 140 | leftHandView.frame = snapshotRegion; 141 | [containerView addSubview:leftHandView]; 142 | 143 | // snapshot the right-hand side of the view 144 | snapshotRegion = CGRectMake(view.frame.size.width / 2, 0, view.frame.size.width / 2, view.frame.size.height); 145 | UIView *rightHandView = [view resizableSnapshotViewFromRect:snapshotRegion afterScreenUpdates:afterUpdates withCapInsets:UIEdgeInsetsZero]; 146 | rightHandView.frame = snapshotRegion; 147 | [containerView addSubview:rightHandView]; 148 | 149 | // send the view that was snapshotted to the back 150 | [containerView sendSubviewToBack:view]; 151 | 152 | return @[leftHandView, rightHandView]; 153 | } 154 | 155 | // updates the anchor point for the given view, offseting the frame to compensate for the resulting movement 156 | - (void)updateAnchorPointAndOffset:(CGPoint)anchorPoint view:(UIView*)view { 157 | view.layer.anchorPoint = anchorPoint; 158 | float xOffset = anchorPoint.x - 0.5; 159 | view.frame = CGRectOffset(view.frame, xOffset * view.frame.size.width, 0); 160 | } 161 | 162 | 163 | - (CATransform3D) rotate:(CGFloat) angle { 164 | return CATransform3DMakeRotation(angle, 0.0, 1.0, 0.0); 165 | } 166 | 167 | @end 168 | -------------------------------------------------------------------------------- /AnimationControllers/CEFoldAnimationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CEAccordionAnimationController.h 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 12/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CEReversibleAnimationController.h" 10 | 11 | /** 12 | Animates between the two view controllers using a paper-fold style transition. You can configure the number of folds via the `folds` property. 13 | */ 14 | @interface CEFoldAnimationController : CEReversibleAnimationController 15 | 16 | @property (nonatomic) NSUInteger folds; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /AnimationControllers/CEFoldAnimationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CEAccordionAnimationController.m 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 12/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CEFoldAnimationController.h" 10 | 11 | @implementation CEFoldAnimationController 12 | 13 | - (id)init { 14 | if (self = [super init]) { 15 | self.folds = 2; 16 | } 17 | return self; 18 | } 19 | 20 | - (void)animateTransition:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView { 21 | 22 | // Add the toView to the container 23 | UIView* containerView = [transitionContext containerView]; 24 | 25 | // move offscreen 26 | toView.frame = [transitionContext finalFrameForViewController:toVC]; 27 | toView.frame = CGRectOffset(toView.frame, toView.frame.size.width, 0); 28 | [containerView addSubview:toView]; 29 | 30 | // Add a perspective transform 31 | CATransform3D transform = CATransform3DIdentity; 32 | transform.m34 = -0.005; 33 | containerView.layer.sublayerTransform = transform; 34 | 35 | CGSize size = toView.frame.size; 36 | 37 | float foldWidth = size.width * 0.5 / (float)self.folds ; 38 | 39 | // arrays that hold the snapshot views 40 | NSMutableArray* fromViewFolds = [NSMutableArray new]; 41 | NSMutableArray* toViewFolds = [NSMutableArray new]; 42 | 43 | // create the folds for the form- and to- views 44 | for (int i=0 ;i)transitionContext { 16 | // Grab the from and to view controllers from the context 17 | UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 18 | UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 19 | 20 | [transitionContext.containerView addSubview:fromViewController.view]; 21 | [transitionContext.containerView addSubview:toViewController.view]; 22 | 23 | CALayer *fromLayer; 24 | CALayer *toLayer; 25 | 26 | if (self.reverse) { 27 | toViewController.view.userInteractionEnabled = YES; 28 | 29 | fromLayer = toViewController.view.layer; 30 | toLayer = fromViewController.view.layer; 31 | 32 | // Reset to initial transform 33 | sourceLastTransform(fromLayer); 34 | destinationLastTransform(toLayer); 35 | 36 | 37 | //Perform animation 38 | [UIView animateKeyframesWithDuration:self.duration 39 | delay:0.0 40 | options:UIViewKeyframeAnimationOptionCalculationModeCubic 41 | animations:^{ 42 | 43 | [UIView addKeyframeWithRelativeStartTime:0.0f 44 | relativeDuration:kAnimationFirstPartRatio 45 | animations:^{ 46 | sourceFirstTransform(fromLayer); 47 | }]; 48 | 49 | [UIView addKeyframeWithRelativeStartTime:0.0f 50 | relativeDuration:1.0f 51 | animations:^{ 52 | destinationFirstTransform(toLayer); 53 | }]; 54 | 55 | } completion:^(BOOL finished) { 56 | // Bring the from view back to the front and re-disable the user 57 | // interaction of the to view since the dismissal has been cancelled 58 | if ([transitionContext transitionWasCancelled]) 59 | { 60 | [transitionContext.containerView bringSubviewToFront:fromViewController.view]; 61 | toViewController.view.userInteractionEnabled = NO; 62 | } 63 | 64 | fromViewController.view.layer.transform = CATransform3DIdentity; 65 | toViewController.view.layer.transform = CATransform3DIdentity; 66 | transitionContext.containerView.layer.transform = CATransform3DIdentity; 67 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 68 | }]; 69 | 70 | } else { 71 | fromViewController.view.userInteractionEnabled = NO; 72 | 73 | fromLayer = fromViewController.view.layer; 74 | toLayer = toViewController.view.layer; 75 | 76 | // Change anchor point and reposition it. 77 | CGRect oldFrame = fromLayer.frame; 78 | [fromLayer setAnchorPoint:CGPointMake(0.0f, 0.5f)]; 79 | [fromLayer setFrame:oldFrame]; 80 | 81 | // Reset to initial transform 82 | sourceFirstTransform(fromLayer); 83 | destinationFirstTransform(toLayer); 84 | 85 | //Perform animation 86 | [UIView animateKeyframesWithDuration:self.duration 87 | delay:0.0 88 | options:UIViewKeyframeAnimationOptionCalculationModeCubic 89 | animations:^{ 90 | 91 | [UIView addKeyframeWithRelativeStartTime:0.0f 92 | relativeDuration:1.0f 93 | animations:^{ 94 | destinationLastTransform(toLayer); 95 | }]; 96 | 97 | [UIView addKeyframeWithRelativeStartTime:(1.0f - kAnimationFirstPartRatio) 98 | relativeDuration:kAnimationFirstPartRatio 99 | animations:^{ 100 | sourceLastTransform(fromLayer); 101 | }]; 102 | 103 | } completion:^(BOOL finished) { 104 | // Bring the from view back to the front and re-enable its user 105 | // interaction since the presentation has been cancelled 106 | if ([transitionContext transitionWasCancelled]) 107 | { 108 | [transitionContext.containerView bringSubviewToFront:fromViewController.view]; 109 | fromViewController.view.userInteractionEnabled = YES; 110 | } 111 | 112 | fromViewController.view.layer.transform = CATransform3DIdentity; 113 | toViewController.view.layer.transform = CATransform3DIdentity; 114 | transitionContext.containerView.layer.transform = CATransform3DIdentity; 115 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 116 | }]; 117 | } 118 | 119 | } 120 | 121 | #pragma mark - 122 | 123 | #pragma mark - Required 3d Transform 124 | static void sourceFirstTransform(CALayer *layer) { 125 | CATransform3D t = CATransform3DIdentity; 126 | t.m34 = 1.0 / -500; 127 | t = CATransform3DTranslate(t, 0.0f, 0.0f, 0.0f); 128 | layer.transform = t; 129 | } 130 | 131 | static void sourceLastTransform(CALayer *layer) { 132 | CATransform3D t = CATransform3DIdentity; 133 | t.m34 = 1.0 / -500.0f; 134 | t = CATransform3DRotate(t, radianFromDegree(80), 0.0f, 1.0f, 0.0f); 135 | t = CATransform3DTranslate(t, 0.0f, 0.0f, -30.0f); 136 | t = CATransform3DTranslate(t, 170.0f, 0.0f, 0.0f); 137 | layer.transform = t; 138 | } 139 | 140 | static void destinationFirstTransform(CALayer * layer) { 141 | CATransform3D t = CATransform3DIdentity; 142 | t.m34 = 1.0f / -500.0f; 143 | // Rotate 5 degrees within the axis of z axis 144 | t = CATransform3DRotate(t, radianFromDegree(5.0f), 0.0f, 0.0f, 1.0f); 145 | // Reposition toward to the left where it initialized 146 | t = CATransform3DTranslate(t, 320.0f, -40.0f, 150.0f); 147 | // Rotate it -45 degrees within the y axis 148 | t = CATransform3DRotate(t, radianFromDegree(-45), 0.0f, 1.0f, 0.0f); 149 | // Rotate it 10 degrees within thee x axis 150 | t = CATransform3DRotate(t, radianFromDegree(10), 1.0f, 0.0f, 0.0f); 151 | layer.transform = t; 152 | } 153 | 154 | static void destinationLastTransform(CALayer * layer) { 155 | CATransform3D t = CATransform3DIdentity; 156 | t.m34 = 1.0/ -500; 157 | // Rotate to 0 degrees within z axis 158 | t = CATransform3DRotate(t, radianFromDegree(0), 0.0f, 0.0f, 1.0f); 159 | // Bring back to the final position 160 | t = CATransform3DTranslate(t, 0.0f, 0.0f, 0.0f); 161 | // Rotate 0 degrees within y axis 162 | t = CATransform3DRotate(t, radianFromDegree(0), 0.0f, 1.0f, 0.0f); 163 | // Rotate 0 degrees within x axis 164 | t = CATransform3DRotate(t, radianFromDegree(0), 1.0f, 0.0f, 0.0f); 165 | layer.transform = t; 166 | } 167 | 168 | #pragma mark - Convert Degrees to Radian 169 | static double radianFromDegree(float degrees) { 170 | return (degrees / 180) * M_PI; 171 | } 172 | 173 | @end 174 | -------------------------------------------------------------------------------- /AnimationControllers/CEPanAnimationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CEPanAnimationController.h 3 | // TransitionsDemo 4 | // 5 | // Created by Alvin Zeng on 01/08/2014. 6 | // Copyright (c) 2014 Alvin Zeng. All rights reserved. 7 | // 8 | 9 | #import "CEReversibleAnimationController.h" 10 | 11 | /** 12 | Animates between the two view controllers by performing a simple pan. 13 | */ 14 | @interface CEPanAnimationController : CEReversibleAnimationController 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /AnimationControllers/CEPanAnimationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CEPanAnimationController.m 3 | // TransitionsDemo 4 | // 5 | // Created by Alvin Zeng on 01/08/2014. 6 | // Copyright (c) 2014 Alvin Zeng. All rights reserved. 7 | // 8 | 9 | #import "CEPanAnimationController.h" 10 | 11 | @implementation CEPanAnimationController 12 | 13 | - (void)animateTransition:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView { 14 | 15 | self.duration = .3; 16 | // Add the toView to the container 17 | UIView* containerView = [transitionContext containerView]; 18 | [containerView addSubview:toView]; 19 | toView.frame = CGRectMake(self.reverse ? -160 : 320, toView.frame.origin.y, toView.frame.size.width, toView.frame.size.height); 20 | 21 | self.reverse ? [containerView sendSubviewToBack:toView] : [containerView bringSubviewToFront:toView]; 22 | 23 | // animate 24 | NSTimeInterval duration = [self transitionDuration:transitionContext]; 25 | [UIView animateWithDuration:duration animations:^{ 26 | fromView.frame = CGRectMake(!self.reverse ? -160 : 320, fromView.frame.origin.y, fromView.frame.size.width, fromView.frame.size.height); 27 | toView.frame = CGRectMake(0, toView.frame.origin.y, toView.frame.size.width, toView.frame.size.height); 28 | } completion:^(BOOL finished) { 29 | if ([transitionContext transitionWasCancelled]) { 30 | toView.frame = CGRectMake(0, toView.frame.origin.y, toView.frame.size.width, toView.frame.size.height); 31 | fromView.frame = CGRectMake(0, fromView.frame.origin.y, fromView.frame.size.width, fromView.frame.size.height); 32 | } else { 33 | // reset from- view to its original state 34 | [fromView removeFromSuperview]; 35 | fromView.frame = CGRectMake(!self.reverse ? -160 : 320, fromView.frame.origin.y, fromView.frame.size.width, fromView.frame.size.height); 36 | toView.frame = CGRectMake(0, toView.frame.origin.y, toView.frame.size.width, toView.frame.size.height); 37 | } 38 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 39 | }]; 40 | 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /AnimationControllers/CEPortalAnimationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZENPortalAnimationController.h 3 | // ZEN BabyBook 4 | // 5 | // Created by Frédéric ADDA on 07/12/2013. 6 | // Copyright (c) 2013 Frédéric ADDA. All rights reserved. 7 | // 8 | 9 | #import "CEReversibleAnimationController.h" 10 | 11 | /* 12 | Animates between the two view controllers using a portal-opening transition. 13 | */ 14 | 15 | @interface CEPortalAnimationController : CEReversibleAnimationController 16 | @end 17 | -------------------------------------------------------------------------------- /AnimationControllers/CEPortalAnimationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZENPortalAnimationController.m 3 | // ZEN BabyBook 4 | // 5 | // Created by Frédéric ADDA on 07/12/2013. 6 | // Copyright (c) 2013 Frédéric ADDA. All rights reserved. 7 | // 8 | 9 | #import "CEPortalAnimationController.h" 10 | 11 | @implementation CEPortalAnimationController 12 | 13 | - (void)animateTransition:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView { 14 | 15 | if(self.reverse){ 16 | [self executeReverseAnimation:transitionContext fromVC:fromVC toVC:toVC fromView:fromView toView:toView]; 17 | } else { 18 | [self executeForwardsAnimation:transitionContext fromVC:fromVC toVC:toVC fromView:fromView toView:toView]; 19 | } 20 | 21 | } 22 | 23 | #define ZOOM_SCALE 0.8 24 | - (void)executeForwardsAnimation:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView { 25 | 26 | UIView *containerView = [transitionContext containerView]; 27 | 28 | // Add a reduced snapshot of the toView to the container 29 | UIView *toViewSnapshot = [toView resizableSnapshotViewFromRect:toView.frame afterScreenUpdates:YES withCapInsets:UIEdgeInsetsZero]; 30 | CATransform3D scale = CATransform3DIdentity; 31 | toViewSnapshot.layer.transform = CATransform3DScale(scale, ZOOM_SCALE, ZOOM_SCALE, 1); 32 | [containerView addSubview:toViewSnapshot]; 33 | [containerView sendSubviewToBack:toViewSnapshot]; 34 | 35 | 36 | // Create two-part snapshots of the from- view 37 | 38 | // snapshot the left-hand side of the from- view 39 | CGRect leftSnapshotRegion = CGRectMake(0, 0, fromView.frame.size.width / 2, fromView.frame.size.height); 40 | UIView *leftHandView = [fromView resizableSnapshotViewFromRect:leftSnapshotRegion afterScreenUpdates:NO withCapInsets:UIEdgeInsetsZero]; 41 | leftHandView.frame = leftSnapshotRegion; 42 | [containerView addSubview:leftHandView]; 43 | 44 | // snapshot the right-hand side of the from- view 45 | CGRect rightSnapshotRegion = CGRectMake(fromView.frame.size.width / 2, 0, fromView.frame.size.width / 2, fromView.frame.size.height); 46 | UIView *rightHandView = [fromView resizableSnapshotViewFromRect:rightSnapshotRegion afterScreenUpdates:NO withCapInsets:UIEdgeInsetsZero]; 47 | rightHandView.frame = rightSnapshotRegion; 48 | [containerView addSubview:rightHandView]; 49 | 50 | // remove the view that was snapshotted 51 | [fromView removeFromSuperview]; 52 | 53 | // animate 54 | NSTimeInterval duration = [self transitionDuration:transitionContext]; 55 | 56 | [UIView animateWithDuration:duration 57 | delay:0.0 58 | options:UIViewAnimationOptionCurveEaseOut 59 | animations:^{ 60 | // Open the portal doors of the from-view 61 | leftHandView.frame = CGRectOffset(leftHandView.frame, - leftHandView.frame.size.width, 0); 62 | rightHandView.frame = CGRectOffset(rightHandView.frame, rightHandView.frame.size.width, 0); 63 | 64 | // zoom in the to-view 65 | toViewSnapshot.center = toView.center; 66 | toViewSnapshot.frame = toView.frame; 67 | 68 | } completion:^(BOOL finished) { 69 | 70 | // remove all the temporary views 71 | if ([transitionContext transitionWasCancelled]) { 72 | [containerView addSubview:fromView]; 73 | [self removeOtherViews:fromView]; 74 | } else { 75 | // add the real to- view and remove the snapshots 76 | [containerView addSubview:toView]; 77 | [self removeOtherViews:toView]; 78 | } 79 | 80 | // inform the context of completion 81 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 82 | }]; 83 | 84 | } 85 | 86 | 87 | 88 | - (void)executeReverseAnimation:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView { 89 | 90 | UIView *containerView = [transitionContext containerView]; 91 | 92 | // Add the from-view to the container 93 | [containerView addSubview:fromView]; 94 | 95 | // add the to- view and send offscreen (we need to do this in order to allow snapshotting) 96 | toView.frame = [transitionContext finalFrameForViewController:toVC]; 97 | toView.frame = CGRectOffset(toView.frame, toView.frame.size.width, 0); 98 | [containerView addSubview:toView]; 99 | 100 | 101 | // Create two-part snapshots of the to- view 102 | 103 | // snapshot the left-hand side of the to- view 104 | CGRect leftSnapshotRegion = CGRectMake(0, 0, toView.frame.size.width / 2, toView.frame.size.height); 105 | UIView *leftHandView = [toView resizableSnapshotViewFromRect:leftSnapshotRegion afterScreenUpdates:YES withCapInsets:UIEdgeInsetsZero]; 106 | leftHandView.frame = leftSnapshotRegion; 107 | // reverse animation : start from beyond the edges of the screen 108 | leftHandView.frame = CGRectOffset(leftHandView.frame, - leftHandView.frame.size.width, 0); 109 | [containerView addSubview:leftHandView]; 110 | 111 | // snapshot the right-hand side of the to- view 112 | CGRect rightSnapshotRegion = CGRectMake(toView.frame.size.width / 2, 0, toView.frame.size.width / 2, toView.frame.size.height); 113 | UIView *rightHandView = [toView resizableSnapshotViewFromRect:rightSnapshotRegion afterScreenUpdates:YES withCapInsets:UIEdgeInsetsZero]; 114 | rightHandView.frame = rightSnapshotRegion; 115 | // reverse animation : start from beyond the edges of the screen 116 | rightHandView.frame = CGRectOffset(rightHandView.frame, rightHandView.frame.size.width, 0); 117 | [containerView addSubview:rightHandView]; 118 | 119 | // animate 120 | NSTimeInterval duration = [self transitionDuration:transitionContext]; 121 | 122 | 123 | [UIView animateWithDuration:duration 124 | delay:0.0 125 | options:UIViewAnimationOptionCurveEaseOut 126 | animations:^{ 127 | // Close the portal doors of the to-view 128 | leftHandView.frame = CGRectOffset(leftHandView.frame, leftHandView.frame.size.width, 0); 129 | rightHandView.frame = CGRectOffset(rightHandView.frame, - rightHandView.frame.size.width, 0); 130 | 131 | // Zoom out the from-view 132 | CATransform3D scale = CATransform3DIdentity; 133 | fromView.layer.transform = CATransform3DScale(scale, ZOOM_SCALE, ZOOM_SCALE, 1); 134 | 135 | 136 | } completion:^(BOOL finished) { 137 | 138 | // remove all the temporary views 139 | if ([transitionContext transitionWasCancelled]) { 140 | [self removeOtherViews:fromView]; 141 | } else { 142 | [self removeOtherViews:toView]; 143 | toView.frame = containerView.bounds; 144 | } 145 | 146 | // inform the context of completion 147 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 148 | }]; 149 | } 150 | 151 | 152 | // removes all the views other than the given view from the superview 153 | - (void)removeOtherViews:(UIView*)viewToKeep { 154 | UIView *containerView = viewToKeep.superview; 155 | for (UIView *view in containerView.subviews) { 156 | if (view != viewToKeep) { 157 | [view removeFromSuperview]; 158 | } 159 | } 160 | } 161 | 162 | @end 163 | -------------------------------------------------------------------------------- /AnimationControllers/CEReversibleAnimationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CEBaseAnimationController.h 3 | // ViewControllerTransitions 4 | // 5 | // Created by Colin Eberhardt on 09/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | A base class for animation controllers which provide reversible animations. A reversible animation is often used with navigation controllers where the reverse property is set based on whether this is a push or pop operation, or for modal view controllers where the reverse property is set based o whether this is a show / dismiss. 13 | */ 14 | @interface CEReversibleAnimationController : NSObject 15 | 16 | /** 17 | The direction of the animation. 18 | */ 19 | @property (nonatomic, assign) BOOL reverse; 20 | 21 | /** 22 | The animation duration. 23 | */ 24 | @property (nonatomic, assign) NSTimeInterval duration; 25 | 26 | - (void)animateTransition:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /AnimationControllers/CEReversibleAnimationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CEBaseAnimationController.m 3 | // ViewControllerTransitions 4 | // 5 | // Created by Colin Eberhardt on 09/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CEReversibleAnimationController.h" 10 | 11 | @implementation CEReversibleAnimationController 12 | 13 | - (id)init { 14 | if (self = [super init]) { 15 | self.duration = 1.0f; 16 | } 17 | return self; 18 | } 19 | 20 | - (NSTimeInterval)transitionDuration:(id)transitionContext { 21 | return self.duration; 22 | } 23 | 24 | - (void)animateTransition:(id)transitionContext { 25 | 26 | UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 27 | UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 28 | UIView *toView = toVC.view; 29 | UIView *fromView = fromVC.view; 30 | 31 | [self animateTransition:transitionContext fromVC:fromVC toVC:toVC fromView:fromView toView:toView]; 32 | } 33 | 34 | - (void)animateTransition:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView { 35 | } 36 | 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /AnimationControllers/CETurnAnimationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CEFlipAnimationController.h 3 | // ViewControllerTransitions 4 | // 5 | // Created by Colin Eberhardt on 08/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CEReversibleAnimationController.h" 11 | 12 | typedef NS_ENUM(NSInteger, CEDirection) { 13 | CEDirectionHorizontal, 14 | CEDirectionVertical 15 | }; 16 | 17 | /** 18 | Animates between the two view controllers by performing a 3D flip, to reveal the destination view on the back.The turn animation has a `flipDirection` property that specifies the turn orientation. 19 | */ 20 | @interface CETurnAnimationController : CEReversibleAnimationController 21 | 22 | @property (nonatomic, assign) CEDirection flipDirection; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /AnimationControllers/CETurnAnimationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CEFlipAnimationController.m 3 | // ViewControllerTransitions 4 | // 5 | // Created by Colin Eberhardt on 08/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CETurnAnimationController.h" 10 | #import 11 | 12 | @implementation CETurnAnimationController 13 | 14 | - (id)init { 15 | if (self = [super init]) { 16 | self.flipDirection = CEDirectionVertical; 17 | } 18 | return self; 19 | } 20 | 21 | - (void)animateTransition:(id)transitionContext fromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC fromView:(UIView *)fromView toView:(UIView *)toView { 22 | 23 | // Add the toView to the container 24 | UIView* containerView = [transitionContext containerView]; 25 | [containerView addSubview:toView]; 26 | 27 | // Add a perspective transform 28 | CATransform3D transform = CATransform3DIdentity; 29 | transform.m34 = -0.002; 30 | [containerView.layer setSublayerTransform:transform]; 31 | 32 | // Give both VCs the same start frame 33 | CGRect initialFrame = [transitionContext initialFrameForViewController:fromVC]; 34 | fromView.frame = initialFrame; 35 | toView.frame = initialFrame; 36 | 37 | // reverse? 38 | float factor = self.reverse ? 1.0 : -1.0; 39 | 40 | // flip the to VC halfway round - hiding it 41 | toView.layer.transform = [self rotate:factor * -M_PI_2]; 42 | 43 | // animate 44 | NSTimeInterval duration = [self transitionDuration:transitionContext]; 45 | [UIView animateKeyframesWithDuration:duration 46 | delay:0.0 47 | options:0 48 | animations:^{ 49 | [UIView addKeyframeWithRelativeStartTime:0.0 50 | relativeDuration:0.5 51 | animations:^{ 52 | // rotate the from view 53 | fromView.layer.transform = [self rotate:factor * M_PI_2]; 54 | }]; 55 | [UIView addKeyframeWithRelativeStartTime:0.5 56 | relativeDuration:0.5 57 | animations:^{ 58 | // rotate the to view 59 | toView.layer.transform = [self rotate:0.0]; 60 | }]; 61 | } completion:^(BOOL finished) { 62 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 63 | }]; 64 | 65 | } 66 | 67 | - (CATransform3D) rotate:(CGFloat) angle { 68 | if (self.flipDirection == CEDirectionHorizontal) 69 | return CATransform3DMakeRotation(angle, 1.0, 0.0, 0.0); 70 | else 71 | return CATransform3DMakeRotation(angle, 0.0, 1.0, 0.0); 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Version 1.1.0 2 | 3 | + Added `CECardsAnimationController` 4 | + Added `CEVerticalSwipeInteractionController` 5 | + Renamed `CESwipeInteractionController` to `CEHorizontalInteractionController` 6 | 7 | # Version 1.0.0 8 | 9 | Initial release. -------------------------------------------------------------------------------- /InteractionControllers/CEBaseInteractionController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CEBaseInteractionController.h 3 | // ViewControllerTransitions 4 | // 5 | // Created by Colin Eberhardt on 10/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | An enumeration that describes the navigation operation that an interaction controller should initiate. 13 | */ 14 | typedef NS_ENUM(NSInteger, CEInteractionOperation) { 15 | /** 16 | Indicates that the interaction controller should start a navigation controller 'pop' navigation. 17 | */ 18 | CEInteractionOperationPop, 19 | /** 20 | Indicates that the interaction controller should initiate a modal 'dismiss'. 21 | */ 22 | CEInteractionOperationDismiss, 23 | /** 24 | Indicates that the interaction controller should navigate between tabs. 25 | */ 26 | CEInteractionOperationTab 27 | }; 28 | 29 | /** 30 | A base class for interaction controllers that can be used with navigation controllers to perform pop operations, or with view controllers that have been presented modally to perform dismissal. 31 | */ 32 | @interface CEBaseInteractionController : UIPercentDrivenInteractiveTransition 33 | 34 | /** 35 | Connects this interaction controller to the given view controller. 36 | @param viewController The view controller which this interaction should add a gesture recognizer to. 37 | @param operation The operation that this interaction initiates when. 38 | */ 39 | - (void)wireToViewController:(UIViewController*)viewController forOperation:(CEInteractionOperation)operation; 40 | 41 | /** 42 | This property indicates whether an interactive transition is in progress. 43 | */ 44 | @property (nonatomic, assign) BOOL interactionInProgress; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /InteractionControllers/CEBaseInteractionController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CEBaseInteractionController.m 3 | // ViewControllerTransitions 4 | // 5 | // Created by Colin Eberhardt on 10/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CEBaseInteractionController.h" 10 | 11 | @implementation CEBaseInteractionController 12 | 13 | - (void)wireToViewController:(UIViewController *)viewController forOperation:(CEInteractionOperation)operation { 14 | 15 | @throw [NSException exceptionWithName:NSInternalInconsistencyException 16 | reason:[NSString stringWithFormat:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)] 17 | userInfo:nil]; 18 | 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /InteractionControllers/CEHorizontalSwipeInteractionController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SwipeInteractionController.h 3 | // ILoveCatz 4 | // 5 | // Created by Colin Eberhardt on 22/08/2013. 6 | // Copyright (c) 2013 com.razeware. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CEBaseInteractionController.h" 11 | 12 | /** 13 | A horizontal swipe interaction controller. When used with a navigation controller, a right-to-left, or left-to-right swipe 14 | will cause a 'pop' navigation. When used wth a tabbar controller, right-to-left and left-to-right cause navigation 15 | between neighbouring tabs. 16 | */ 17 | @interface CEHorizontalSwipeInteractionController : CEBaseInteractionController 18 | 19 | /** 20 | Indicates whether a navigation controller 'pop' should occur on a right-to-left, or a left-to-right 21 | swipe. This property does not affect tab controller or modal interactions. 22 | */ 23 | @property (nonatomic) BOOL popOnRightToLeft; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /InteractionControllers/CEHorizontalSwipeInteractionController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SwipeINteractionController.m 3 | // ILoveCatz 4 | // 5 | // Created by Colin Eberhardt on 22/08/2013. 6 | // Copyright (c) 2013 com.razeware. All rights reserved. 7 | // 8 | 9 | #import "CEHorizontalSwipeInteractionController.h" 10 | #import 11 | 12 | const NSString *kCEHorizontalSwipeGestureKey = @"kCEHorizontalSwipeGestureKey"; 13 | 14 | @implementation CEHorizontalSwipeInteractionController { 15 | BOOL _shouldCompleteTransition; 16 | UIViewController *_viewController; 17 | CEInteractionOperation _operation; 18 | } 19 | 20 | 21 | - (void)wireToViewController:(UIViewController *)viewController forOperation:(CEInteractionOperation)operation{ 22 | self.popOnRightToLeft = YES; 23 | _operation = operation; 24 | _viewController = viewController; 25 | [self prepareGestureRecognizerInView:viewController.view]; 26 | } 27 | 28 | 29 | - (void)prepareGestureRecognizerInView:(UIView*)view { 30 | 31 | UIPanGestureRecognizer *gesture = objc_getAssociatedObject(view, (__bridge const void *)(kCEHorizontalSwipeGestureKey)); 32 | 33 | if (gesture) { 34 | [view removeGestureRecognizer:gesture]; 35 | } 36 | 37 | 38 | gesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)]; 39 | [view addGestureRecognizer:gesture]; 40 | 41 | objc_setAssociatedObject(view, (__bridge const void *)(kCEHorizontalSwipeGestureKey), gesture,OBJC_ASSOCIATION_RETAIN_NONATOMIC); 42 | 43 | } 44 | 45 | - (CGFloat)completionSpeed 46 | { 47 | return 1 - self.percentComplete; 48 | } 49 | 50 | - (void)handleGesture:(UIPanGestureRecognizer*)gestureRecognizer { 51 | CGPoint translation = [gestureRecognizer translationInView:gestureRecognizer.view.superview]; 52 | CGPoint vel = [gestureRecognizer velocityInView:gestureRecognizer.view]; 53 | 54 | switch (gestureRecognizer.state) { 55 | case UIGestureRecognizerStateBegan: { 56 | 57 | BOOL rightToLeftSwipe = vel.x < 0; 58 | 59 | // perform the required navigation operation ... 60 | 61 | if (_operation == CEInteractionOperationPop) { 62 | // for pop operation, fire on right-to-left 63 | if ((self.popOnRightToLeft && rightToLeftSwipe) || 64 | (!self.popOnRightToLeft && !rightToLeftSwipe)) { 65 | self.interactionInProgress = YES; 66 | [_viewController.navigationController popViewControllerAnimated:YES]; 67 | } 68 | } else if (_operation == CEInteractionOperationTab) { 69 | // for tab controllers, we need to determine which direction to transition 70 | if (rightToLeftSwipe) { 71 | if (_viewController.tabBarController.selectedIndex < _viewController.tabBarController.viewControllers.count - 1) { 72 | self.interactionInProgress = YES; 73 | _viewController.tabBarController.selectedIndex++; 74 | } 75 | 76 | } else { 77 | if (_viewController.tabBarController.selectedIndex > 0) { 78 | self.interactionInProgress = YES; 79 | _viewController.tabBarController.selectedIndex--; 80 | } 81 | } 82 | } else { 83 | // for dismiss, fire regardless of the translation direction 84 | self.interactionInProgress = YES; 85 | [_viewController dismissViewControllerAnimated:YES completion:nil]; 86 | } 87 | break; 88 | } 89 | case UIGestureRecognizerStateChanged: { 90 | if (self.interactionInProgress) { 91 | // compute the current position 92 | CGFloat fraction = fabs(translation.x / 200.0); 93 | fraction = fminf(fmaxf(fraction, 0.0), 1.0); 94 | _shouldCompleteTransition = (fraction > 0.5); 95 | 96 | // if an interactive transitions is 100% completed via the user interaction, for some reason 97 | // the animation completion block is not called, and hence the transition is not completed. 98 | // This glorious hack makes sure that this doesn't happen. 99 | // see: https://github.com/ColinEberhardt/VCTransitionsLibrary/issues/4 100 | if (fraction >= 1.0) 101 | fraction = 0.99; 102 | 103 | [self updateInteractiveTransition:fraction]; 104 | } 105 | break; 106 | } 107 | case UIGestureRecognizerStateEnded: 108 | case UIGestureRecognizerStateCancelled: 109 | if (self.interactionInProgress) { 110 | self.interactionInProgress = NO; 111 | if (!_shouldCompleteTransition || gestureRecognizer.state == UIGestureRecognizerStateCancelled) { 112 | [self cancelInteractiveTransition]; 113 | } 114 | else { 115 | [self finishInteractiveTransition]; 116 | } 117 | } 118 | break; 119 | default: 120 | break; 121 | } 122 | } 123 | 124 | 125 | @end 126 | -------------------------------------------------------------------------------- /InteractionControllers/CEPinchInteractionController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CEPinchInteractionController.h 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 16/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CEBaseInteractionController.h" 10 | 11 | @interface CEPinchInteractionController : CEBaseInteractionController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /InteractionControllers/CEPinchInteractionController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CEPinchInteractionController.m 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 16/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CEPinchInteractionController.h" 10 | #import 11 | 12 | const NSString *kCEPinchGestureKey = @"kCEPinchGestureKey"; 13 | 14 | @implementation CEPinchInteractionController{ 15 | BOOL _shouldCompleteTransition; 16 | UIViewController *_viewController; 17 | CEInteractionOperation _operation; 18 | CGFloat _startScale; 19 | } 20 | 21 | - (void)wireToViewController:(UIViewController *)viewController forOperation:(CEInteractionOperation)operation{ 22 | _operation = operation; 23 | _viewController = viewController; 24 | [self prepareGestureRecognizerInView:viewController.view]; 25 | } 26 | 27 | 28 | - (void)prepareGestureRecognizerInView:(UIView*)view { 29 | 30 | UIPinchGestureRecognizer *gesture = objc_getAssociatedObject(view, (__bridge const void *)(kCEPinchGestureKey)); 31 | 32 | if (gesture) { 33 | [view removeGestureRecognizer:gesture]; 34 | } 35 | 36 | gesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)]; 37 | [view addGestureRecognizer:gesture]; 38 | 39 | objc_setAssociatedObject(view, (__bridge const void *)(kCEPinchGestureKey), gesture,OBJC_ASSOCIATION_RETAIN_NONATOMIC); 40 | 41 | } 42 | 43 | - (CGFloat)completionSpeed 44 | { 45 | return 1 - self.percentComplete; 46 | } 47 | 48 | - (void)handleGesture:(UIPinchGestureRecognizer*)gestureRecognizer { 49 | 50 | switch (gestureRecognizer.state) { 51 | case UIGestureRecognizerStateBegan: 52 | _startScale = gestureRecognizer.scale; 53 | 54 | // start an interactive transition! 55 | self.interactionInProgress = YES; 56 | 57 | // perform the required operation 58 | if (_operation == CEInteractionOperationPop) { 59 | [_viewController.navigationController popViewControllerAnimated:YES]; 60 | } else { 61 | [_viewController dismissViewControllerAnimated:YES completion:nil]; 62 | } 63 | break; 64 | case UIGestureRecognizerStateChanged: { 65 | // compute the current pinch fraction 66 | CGFloat fraction = 1.0 - gestureRecognizer.scale / _startScale; 67 | _shouldCompleteTransition = (fraction > 0.5); 68 | [self updateInteractiveTransition:fraction]; 69 | break; 70 | } 71 | case UIGestureRecognizerStateEnded: 72 | case UIGestureRecognizerStateCancelled: 73 | self.interactionInProgress = NO; 74 | if (!_shouldCompleteTransition || gestureRecognizer.state == UIGestureRecognizerStateCancelled) { 75 | [self cancelInteractiveTransition]; 76 | } 77 | else { 78 | [self finishInteractiveTransition]; 79 | } 80 | break; 81 | default: 82 | break; 83 | } 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /InteractionControllers/CEVerticalSwipeInteractionController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CEVerticalSwipeInteactionController.h 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 22/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CEBaseInteractionController.h" 10 | 11 | /** 12 | A horizontal swipe interaction controller. When used with a navigation controller, a top-to-bottom swipe 13 | will cause a 'pop' navigation. This interaction controller cannot be used with a tabbar controller. That would be silly. 14 | */ 15 | @interface CEVerticalSwipeInteractionController : CEBaseInteractionController 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /InteractionControllers/CEVerticalSwipeInteractionController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CEVerticalSwipeInteactionController.m 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 22/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "CEVerticalSwipeInteractionController.h" 10 | #import 11 | 12 | const NSString *kCEVerticalSwipeGestureKey = @"kCEVerticalSwipeGestureKey"; 13 | 14 | @implementation CEVerticalSwipeInteractionController { 15 | BOOL _shouldCompleteTransition; 16 | UIViewController *_viewController; 17 | CEInteractionOperation _operation; 18 | } 19 | 20 | 21 | - (void)wireToViewController:(UIViewController *)viewController forOperation:(CEInteractionOperation)operation{ 22 | 23 | if (operation == CEInteractionOperationTab) { 24 | @throw [NSException exceptionWithName:NSInternalInconsistencyException 25 | reason:@"You cannot use a vertical swipe interaction with a tabbar controller - that would be silly!" 26 | userInfo:nil]; 27 | } 28 | _operation = operation; 29 | _viewController = viewController; 30 | [self prepareGestureRecognizerInView:viewController.view]; 31 | } 32 | 33 | 34 | - (void)prepareGestureRecognizerInView:(UIView*)view { 35 | UIPanGestureRecognizer *gesture = objc_getAssociatedObject(view, (__bridge const void *)(kCEVerticalSwipeGestureKey)); 36 | 37 | if (gesture) { 38 | [view removeGestureRecognizer:gesture]; 39 | } 40 | 41 | gesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)]; 42 | [view addGestureRecognizer:gesture]; 43 | 44 | objc_setAssociatedObject(view, (__bridge const void *)(kCEVerticalSwipeGestureKey), gesture,OBJC_ASSOCIATION_RETAIN_NONATOMIC); 45 | 46 | } 47 | 48 | - (CGFloat)completionSpeed 49 | { 50 | return 1 - self.percentComplete; 51 | } 52 | 53 | - (void)handleGesture:(UIPanGestureRecognizer*)gestureRecognizer { 54 | CGPoint translation = [gestureRecognizer translationInView:gestureRecognizer.view.superview]; 55 | 56 | switch (gestureRecognizer.state) { 57 | case UIGestureRecognizerStateBegan: { 58 | 59 | BOOL topToBottomSwipe = translation.y > 0; 60 | 61 | // perform the required navigation operation ... 62 | 63 | if (_operation == CEInteractionOperationPop) { 64 | // for pop operation, fire on top-to-bottom 65 | if (topToBottomSwipe) { 66 | self.interactionInProgress = YES; 67 | [_viewController.navigationController popViewControllerAnimated:YES]; 68 | } 69 | } else { 70 | // for dismiss, fire regardless of the translation direction 71 | self.interactionInProgress = YES; 72 | [_viewController dismissViewControllerAnimated:YES completion:nil]; 73 | } 74 | break; 75 | } 76 | case UIGestureRecognizerStateChanged: { 77 | if (self.interactionInProgress) { 78 | // compute the current position 79 | CGFloat fraction = fabs(translation.y / 200.0); 80 | fraction = fminf(fmaxf(fraction, 0.0), 1.0); 81 | _shouldCompleteTransition = (fraction > 0.5); 82 | 83 | // if an interactive transitions is 100% completed via the user interaction, for some reason 84 | // the animation completion block is not called, and hence the transition is not completed. 85 | // This glorious hack makes sure that this doesn't happen. 86 | // see: https://github.com/ColinEberhardt/VCTransitionsLibrary/issues/4 87 | if (fraction >= 1.0) 88 | fraction = 0.99; 89 | 90 | [self updateInteractiveTransition:fraction]; 91 | } 92 | break; 93 | } 94 | case UIGestureRecognizerStateEnded: 95 | case UIGestureRecognizerStateCancelled: 96 | if (self.interactionInProgress) { 97 | self.interactionInProgress = NO; 98 | if (!_shouldCompleteTransition || gestureRecognizer.state == UIGestureRecognizerStateCancelled) { 99 | [self cancelInteractiveTransition]; 100 | } 101 | else { 102 | [self finishInteractiveTransition]; 103 | } 104 | } 105 | break; 106 | default: 107 | break; 108 | } 109 | } 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2013 Colin Eberhardt 2 | Linq to Objective-C 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # View Controller Transitions Library 2 | 3 | With iOS 7 you can easily create custom view controller transitions that can be used in a range of contexts (push, pop, modal …). This project provides a library of custom animations which can be dropped directly into your project. It also has a number of 'interaction controllers' which can be used with any of the custom animations in order to make your transitions interactive. 4 | 5 | The library currently contains the following animations, which can be made interactive with either a swipe or pinch gesture. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
FlipFoldCrossfadeExplode
TurnCardsNatGeoPortal
CubePan
45 | 46 | ## Contents 47 | 48 | * [A brief introduction to custom transitions](#a-brief-introduction-to-custom-transitions) 49 | * [Adding custom transitions to your project](#adding-custom-transitions-to-your-project) 50 | * [Grabbing the code](#grabbing-the-code) 51 | * [Using an animation controller](#using-an-animation-controller) 52 | * [Custom present / dismiss transitions](#custom-present--dismiss-transitions) 53 | * [Custom navigation controller transitions](#custom-navigation-controller-transitions) 54 | * [Custom tab bar controller transitions](#custom-tab-bar-controller-transitions) 55 | * [Using an interaction controller](#using-an-interaction-controller) 56 | * [Interactive dismiss transitions](#interactive-dismiss-transitions) 57 | * [Interactive pop transitions](#interactive-pop-transitions) 58 | * [Interactive tab transitions](#interactive-tab-transitions) 59 | * [Transitions library](#transitions-library) 60 | 61 | 62 | ## A brief introduction to custom transitions 63 | 64 | The following provides a very brief introduction to the concepts, for more detailed coverage I would thoroughly recommend reading Chapter 3 of [iOS 7 By Tutorials](http://www.raywenderlich.com/store/ios-7-by-tutorials?source=ceberhardt) - which I wrote! (I've heard the other 15 chapters are pretty good too ;-) 65 | 66 | There are two key classes involved in a custom transition: 67 | 68 | + **Animation controller** - this class is responsible for performing the custom transitions. When you indicate that a custom transitions should be used, you provide an animation controller. This class performs the required animation, then informs the framework when it has completed. 69 | + **Interaction controller** - this class is responsible for managing interactive transitions - these are transitions that typically controlled by a gesture, allowing the user to swipe, pinch or perform some other action to navigate between view controllers. Importantly, interaction controllers allow transitions to be cancelled, i.e. a user can start the navigation, change their mind, and reverse it! 70 | 71 | **NOTE:** Animation and interaction controllers are entirely independent, this means you can wire up any interaction controller with any animation controller - which is pretty awesome. 72 | 73 | ## Adding custom transitions to your project 74 | 75 | This sections gives a brief overview of the steps required to add custom view controller transitions to your project. You might also want to look at the code for the demo app (in the `TransitionsDemo` folder) for reference. If you already know how the iOS 7 custom view controller transitions work, feel free to skip this section! 76 | 77 | ### Grabbing the code 78 | 79 | There are a couple of ways you can incorporate transitions from this library into your code: 80 | 81 | 1. **CocoaPods** - simply add a reference to **VCTransitionsLibrary** to your pod file. 82 | 2. **Manual file copy** - if you are not using CocoaPods, you can simply copy the required files into your project. The `AnimationControllers` and `InteractionControllers` folders contain all the code that is required. 83 | 84 | ### Using an animation controller 85 | 86 | The `AnimationControllers` folder contains a number of animate controllers, which provide custom transitions, which can be integrated into your project as follows: 87 | 88 | #### Custom present / dismiss transitions 89 | 90 | The `UIViewControllerTransitioningDelegate` protocol is used to supply animation controllers for present / dismiss transitions. When a view controller is presented or dismissed the `transitioningDelegate` property of the view controller being presented or dismissed is used to supply this delegate. Simply return one of the animation controllers in response to the `animationControllerForPresentedController: presentingController: sourceController:` message for presenting, and `animationControllerForDismissedController:` for dismissing. 91 | 92 | #### Custom navigation controller transitions 93 | 94 | The `UINavigationControllerDelegate` protocol has methods that can be used to provide animation controllers. Simply return an animation controller in response to the `navigationController: animationControllerForOperation: fromViewController: toViewController:` message. 95 | 96 | Notice that this message has an 'operation' argument that allows you to return different animations for push and pop operations. All of the animation controllers in this library subclass `CEReversibleAnimationController` which allows you to play the animation in reverse. This is commonly used in conjunction with the navigation controller as follows: 97 | 98 | ```objc 99 | - (id)navigationController: 100 | (UINavigationController *)navigationController 101 | animationControllerForOperation:(UINavigationControllerOperation)operation 102 | fromViewController:(UIViewController *)fromVC 103 | toViewController:(UIViewController *)toVC { 104 | 105 | // reverse the animation for 'pop' transitions 106 | _animationController.reverse = operation == UINavigationControllerOperationPop; 107 | 108 | return _animationController; 109 | } 110 | ``` 111 | 112 | #### Custom tab bar controller transitions 113 | 114 | The `UITabBarControllerDelegate` protocol has methods that can be used to provide animation controllers. Simply return an animation controller in response to the `tabBarController: animationControllerForTransitionFromViewController: toViewController:` 115 | message. 116 | 117 | In order to determine the animation direction, you can compare the indices of the two view controller as shown below: 118 | 119 | ```objc 120 | - (id )tabBarController:(UITabBarController *)tabBarController 121 | animationControllerForTransitionFromViewController:(UIViewController *)fromVC 122 | toViewController:(UIViewController *)toVC { 123 | 124 | NSUInteger fromVCIndex = [tabBarController.viewControllers indexOfObject:fromVC]; 125 | NSUInteger toVCIndex = [tabBarController.viewControllers indexOfObject:toVC]; 126 | 127 | _animationController.reverse = fromVCIndex < toVCIndex; 128 | return _animationController; 129 | } 130 | ``` 131 | 132 | 133 | ### Using an interaction controller 134 | 135 | Interaction controllers work in conjunction with an animation controller in order to make a transitions interactive, i.e. allow a user to control a transitions using gestures. This interactivity allows a use to move forwards, backwards and even cancel a transitions. 136 | 137 | The interaction controller is responsible for adding gesture recognisers to the view and triggering the navigation in response to gestures from the user. 138 | 139 | #### Interactive dismiss transitions 140 | 141 | The `UIViewControllerTransitioningDelegate` protocol that is used to supply animation controllers is also used to supply interaction controllers. An example implementation, that uses a swipe interaction together with a flip animation, is show below: 142 | 143 | ```objc 144 | // instance variables, typically instantiated in your init method 145 | CEFlipAnimationController *_animationController; 146 | CESwipeInteractionController *_interactionController; 147 | 148 | - (id) 149 | animationControllerForPresentedController:(UIViewController *)presented 150 | presentingController:(UIViewController *)presenting 151 | sourceController:(UIViewController *)source { 152 | 153 | // allow the interaction controller to wire-up its gesture recognisers 154 | [_interactionController wireToViewController:presented 155 | forOperation:CEInteractionOperationDismiss]; 156 | _animationController.reverse = NO; 157 | return _animationController; 158 | } 159 | 160 | - (id) 161 | animationControllerForDismissedController:(UIViewController *)dismissed { 162 | _animationController.reverse = YES; 163 | return _animationController; 164 | } 165 | 166 | - (id) 167 | interactionControllerForDismissal: 168 | (id)animator { 169 | 170 | // provide the interaction controller, if an interactive transition is in progress 171 | return _interactionController.interactionInProgress 172 | ? _interactionController : nil; 173 | } 174 | ``` 175 | 176 | Note that in the above code the `interactionInProgress` property of the interaction controller is checked. This is because your might want to allow the user to dismiss the view controller using a button as well as via an interaction. Also, you must tell the interaction controller the operation it should perform (i.e. pop, dismiss). 177 | 178 | #### Interactive pop transitions 179 | 180 | The `UINavigationControllerDelegate` protocol also has an equivalent method for returning interactions controllers. A typically implementation, which follows the same pattern as above, is shown: 181 | 182 | ```objc 183 | // instance variables, typically instantiated in your init method 184 | CEFlipAnimationController *_animationController; 185 | CESwipeInteractionController *_interactionController; 186 | 187 | - (id) 188 | navigationController:(UINavigationController *)navigationController 189 | animationControllerForOperation:(UINavigationControllerOperation)operation 190 | fromViewController:(UIViewController *)fromVC 191 | toViewController:(UIViewController *)toVC { 192 | 193 | // wire the interaction controller to the to- view controller 194 | [_interactionController wireToViewController:toVC 195 | forOperation:CEInteractionOperationPop]; 196 | 197 | _animationController.reverse = operation == UINavigationControllerOperationPop; 198 | 199 | return _animationController.reverse; 200 | } 201 | 202 | - (id ) 203 | navigationController:(UINavigationController *)navigationController 204 | interactionControllerForAnimationController:(id )animationController { 205 | 206 | // provide the interaction controller, if an interactive transition is in progress 207 | return _interactionController.interactionInProgress 208 | ? _interactionController : nil; 209 | } 210 | ``` 211 | 212 | #### Interactive tab transitions 213 | 214 | The `UITabBarControllerDelegate` protocol has an equivalent method for returning interactions controllers. As with the navigation controller example above, the interaction controller needs to add its gesture recognisers to the view controllers that the tab bar controller navigates between. Unfortunately the tab bar delegate methods don't get fired when the first view controller is presented, so I opt for a slightly messier implementation using Key-Value observing: 215 | 216 | ```objc 217 | @implementation TabBarViewController { 218 | CEFoldAnimationController *_animationController; 219 | CESwipeInteractionController *_swipeInteractionController; 220 | } 221 | 222 | - (id)initWithCoder:(NSCoder *)aDecoder { 223 | if (self = [super initWithCoder:aDecoder]) { 224 | self.delegate = self; 225 | 226 | // create the interaction / animation controllers 227 | _swipeInteractionController = [CESwipeInteractionController new]; 228 | _animationController = [CEFoldAnimationController new]; 229 | _animationController.folds = 3; 230 | 231 | // observe changes in the currently presented view controller 232 | [self addObserver:self 233 | forKeyPath:@"selectedViewController" 234 | options:NSKeyValueObservingOptionNew 235 | context:nil]; 236 | } 237 | return self; 238 | } 239 | 240 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object 241 | change:(NSDictionary *)change 242 | context:(void *)context 243 | { 244 | if ([keyPath isEqualToString:@"selectedViewController"] ) 245 | { 246 | // wire the interaction controller to the view controller 247 | [_swipeInteractionController wireToViewController:self.selectedViewController 248 | forOperation:CEInteractionOperationTab]; 249 | } 250 | } 251 | 252 | 253 | 254 | - (id )tabBarController:(UITabBarController *)tabBarController 255 | animationControllerForTransitionFromViewController:(UIViewController *)fromVC 256 | toViewController:(UIViewController *)toVC { 257 | 258 | NSUInteger fromVCIndex = [tabBarController.viewControllers indexOfObject:fromVC]; 259 | NSUInteger toVCIndex = [tabBarController.viewControllers indexOfObject:toVC]; 260 | 261 | _animationController.reverse = fromVCIndex < toVCIndex; 262 | return _animationController; 263 | } 264 | 265 | -(id)tabBarController:(UITabBarController *)tabBarController interactionControllerForAnimationController:(id)animationController 266 | { 267 | return _swipeInteractionController.interactionInProgress ? _swipeInteractionController : nil; 268 | } 269 | 270 | @end 271 | ``` 272 | 273 | ## Transitions Library 274 | 275 | The following is a graphical illustration of the various transitions. All animation controllers have a `duration` property that configures the animation duration. 276 | 277 | ### Fold animation - CEFoldAnimationController 278 | 279 | Animates between the two view controllers using a paper-fold style transition. You can configure the number of folds via the `folds` property. 280 | 281 | ![](Screenshots/thumbnails/Fold/1.png) 282 | ![](Screenshots/thumbnails/Fold/2.png) 283 | ![](Screenshots/thumbnails/Fold/3.png) 284 | ![](Screenshots/thumbnails/Fold/4.png) 285 | 286 | ### Flip animation - CEFlipAnimationController 287 | 288 | Animates between the two view controllers using a page-flip transition. 289 | 290 | ![](Screenshots/thumbnails/Flip/1.png) 291 | ![](Screenshots/thumbnails/Flip/2.png) 292 | ![](Screenshots/thumbnails/Flip/3.png) 293 | ![](Screenshots/thumbnails/Flip/4.png) 294 | 295 | ### NatGeo animation - CENatGeoAnimationController 296 | 297 | Animates between the two view controllers using transition inspired by [City Guides by National Geographic](https://itunes.apple.com/us/app/city-guides-by-national-geographic/id592453480?mt=8). 298 | It's an adoptation of [MHNatGeoViewControllerTransition](https://github.com/michaelhenry/MHNatGeoViewControllerTransition/) to iOS7 APIs. 299 | 300 | ![](Screenshots/thumbnails/NatGeo/1.png) 301 | ![](Screenshots/thumbnails/NatGeo/2.png) 302 | ![](Screenshots/thumbnails/NatGeo/3.png) 303 | ![](Screenshots/thumbnails/NatGeo/4.png) 304 | 305 | ### Turn animation - CETurnAnimationController 306 | 307 | Animates between the two view controllers by performing a 3D flip, to reveal the destination view on the back.The turn animation has a `flipDirection` property that specifies the turn orientation. 308 | 309 | ![](Screenshots/thumbnails/Turn/1.png) 310 | ![](Screenshots/thumbnails/Turn/2.png) 311 | ![](Screenshots/thumbnails/Turn/3.png) 312 | ![](Screenshots/thumbnails/Turn/4.png) 313 | 314 | ![](Screenshots/thumbnails/Turn/1a.png) 315 | ![](Screenshots/thumbnails/Turn/2a.png) 316 | ![](Screenshots/thumbnails/Turn/3a.png) 317 | ![](Screenshots/thumbnails/Turn/4a.png) 318 | 319 | ### Crossfade animation - CECrossfadeAnimationController 320 | 321 | Animates between the two view controllers by performing a simple cross-fade. 322 | 323 | ![](Screenshots/thumbnails/Crossfade/1.png) 324 | ![](Screenshots/thumbnails/Crossfade/2.png) 325 | ![](Screenshots/thumbnails/Crossfade/3.png) 326 | ![](Screenshots/thumbnails/Crossfade/4.png) 327 | 328 | ### Explode animation - CEExplodeAnimationController 329 | 330 | Animates between the two view controllers by slicing the from- view controller into lots of little pieces, then randomly spinning and shrinking them. 331 | 332 | ![](Screenshots/thumbnails/Explode/1.png) 333 | ![](Screenshots/thumbnails/Explode/2.png) 334 | ![](Screenshots/thumbnails/Explode/3.png) 335 | ![](Screenshots/thumbnails/Explode/4.png) 336 | 337 | ### Cards animation - CECardsAnimationController 338 | 339 | Gives the impression of one view controller pushing the other to the back. It looks a lot more cool than these static screenshots! 340 | 341 | (courtesy of Tope - AppDesignVault) 342 | 343 | ![](Screenshots/thumbnails/Cards/1.png) 344 | ![](Screenshots/thumbnails/Cards/2.png) 345 | ![](Screenshots/thumbnails/Cards/3.png) 346 | ![](Screenshots/thumbnails/Cards/4.png) 347 | 348 | ### Portal animation - CEPortalAnimationController 349 | 350 | The top-most view controller parts in the middle to reveal the view controller beneath. 351 | 352 | (courtesy of [FreddyF](https://github.com/FredddyF)) 353 | 354 | ![](Screenshots/thumbnails/Portal/4.png) 355 | ![](Screenshots/thumbnails/Portal/3.png) 356 | ![](Screenshots/thumbnails/Portal/2.png) 357 | ![](Screenshots/thumbnails/Portal/1.png) 358 | 359 | ### Cube animation - CECubeAnimationController 360 | 361 | This transition gives the appearance of rotating the faces of a cube. 362 | 363 | (courtesy of [Andrés Brun](https://github.com/andresbrun)) 364 | 365 | ![](Screenshots/thumbnails/Cube/4.png) 366 | ![](Screenshots/thumbnails/Cube/3.png) 367 | ![](Screenshots/thumbnails/Cube/2.png) 368 | ![](Screenshots/thumbnails/Cube/1.png) 369 | 370 | -------------------------------------------------------------------------------- /Screenshots/Cards/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Cards/1.png -------------------------------------------------------------------------------- /Screenshots/Cards/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Cards/2.png -------------------------------------------------------------------------------- /Screenshots/Cards/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Cards/3.png -------------------------------------------------------------------------------- /Screenshots/Cards/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Cards/4.png -------------------------------------------------------------------------------- /Screenshots/Crossfade/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Crossfade/1.png -------------------------------------------------------------------------------- /Screenshots/Crossfade/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Crossfade/2.png -------------------------------------------------------------------------------- /Screenshots/Crossfade/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Crossfade/3.png -------------------------------------------------------------------------------- /Screenshots/Crossfade/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Crossfade/4.png -------------------------------------------------------------------------------- /Screenshots/Cube/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Cube/1.png -------------------------------------------------------------------------------- /Screenshots/Cube/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Cube/2.png -------------------------------------------------------------------------------- /Screenshots/Cube/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Cube/3.png -------------------------------------------------------------------------------- /Screenshots/Cube/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Cube/4.png -------------------------------------------------------------------------------- /Screenshots/Explode/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Explode/1.png -------------------------------------------------------------------------------- /Screenshots/Explode/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Explode/2.png -------------------------------------------------------------------------------- /Screenshots/Explode/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Explode/3.png -------------------------------------------------------------------------------- /Screenshots/Explode/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Explode/4.png -------------------------------------------------------------------------------- /Screenshots/Flip/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Flip/1.png -------------------------------------------------------------------------------- /Screenshots/Flip/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Flip/2.png -------------------------------------------------------------------------------- /Screenshots/Flip/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Flip/3.png -------------------------------------------------------------------------------- /Screenshots/Flip/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Flip/4.png -------------------------------------------------------------------------------- /Screenshots/Fold/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Fold/1.png -------------------------------------------------------------------------------- /Screenshots/Fold/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Fold/2.png -------------------------------------------------------------------------------- /Screenshots/Fold/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Fold/3.png -------------------------------------------------------------------------------- /Screenshots/Fold/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Fold/4.png -------------------------------------------------------------------------------- /Screenshots/NatGeo/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/NatGeo/1.png -------------------------------------------------------------------------------- /Screenshots/NatGeo/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/NatGeo/2.png -------------------------------------------------------------------------------- /Screenshots/NatGeo/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/NatGeo/3.png -------------------------------------------------------------------------------- /Screenshots/NatGeo/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/NatGeo/4.png -------------------------------------------------------------------------------- /Screenshots/Pan/pan_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Pan/pan_1.png -------------------------------------------------------------------------------- /Screenshots/Pan/pan_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Pan/pan_2.png -------------------------------------------------------------------------------- /Screenshots/Pan/pan_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Pan/pan_3.png -------------------------------------------------------------------------------- /Screenshots/Portal/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Portal/1.png -------------------------------------------------------------------------------- /Screenshots/Portal/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Portal/2.png -------------------------------------------------------------------------------- /Screenshots/Portal/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Portal/3.png -------------------------------------------------------------------------------- /Screenshots/Portal/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Portal/4.png -------------------------------------------------------------------------------- /Screenshots/Turn/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Turn/1.png -------------------------------------------------------------------------------- /Screenshots/Turn/1a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Turn/1a.png -------------------------------------------------------------------------------- /Screenshots/Turn/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Turn/2.png -------------------------------------------------------------------------------- /Screenshots/Turn/2a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Turn/2a.png -------------------------------------------------------------------------------- /Screenshots/Turn/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Turn/3.png -------------------------------------------------------------------------------- /Screenshots/Turn/3a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Turn/3a.png -------------------------------------------------------------------------------- /Screenshots/Turn/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Turn/4.png -------------------------------------------------------------------------------- /Screenshots/Turn/4a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/Turn/4a.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Cards/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Cards/1.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Cards/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Cards/2.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Cards/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Cards/3.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Cards/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Cards/4.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Crossfade/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Crossfade/1.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Crossfade/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Crossfade/2.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Crossfade/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Crossfade/3.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Crossfade/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Crossfade/4.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Cube/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Cube/1.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Cube/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Cube/2.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Cube/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Cube/3.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Cube/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Cube/4.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Explode/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Explode/1.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Explode/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Explode/2.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Explode/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Explode/3.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Explode/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Explode/4.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Flip/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Flip/1.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Flip/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Flip/2.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Flip/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Flip/3.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Flip/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Flip/4.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Fold/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Fold/1.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Fold/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Fold/2.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Fold/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Fold/3.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Fold/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Fold/4.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/NatGeo/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/NatGeo/1.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/NatGeo/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/NatGeo/2.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/NatGeo/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/NatGeo/3.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/NatGeo/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/NatGeo/4.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Pan/pan_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Pan/pan_1.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Pan/pan_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Pan/pan_2.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Portal/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Portal/1.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Portal/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Portal/2.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Portal/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Portal/3.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Portal/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Portal/4.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Turn/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Turn/1.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Turn/1a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Turn/1a.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Turn/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Turn/2.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Turn/2a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Turn/2a.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Turn/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Turn/3.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Turn/3a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Turn/3a.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Turn/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Turn/4.png -------------------------------------------------------------------------------- /Screenshots/thumbnails/Turn/4a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinEberhardt/VCTransitionsLibrary/4ce0512ffac852abf44643295860661366230d9f/Screenshots/thumbnails/Turn/4a.png -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo.xcodeproj/project.xcworkspace/xcshareddata/TabBarDemo.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 1E84E93D-E2FA-4FCE-803F-2A2971E98742 9 | IDESourceControlProjectName 10 | TabBarDemo 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | C9B960E113CD2F1E13B17A07CE56CB3BD674F912 14 | https://github.com/cyndibaby905/VCTransitionsLibrary.git 15 | 16 | IDESourceControlProjectPath 17 | TabBarDemo/TabBarDemo.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | C9B960E113CD2F1E13B17A07CE56CB3BD674F912 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/cyndibaby905/VCTransitionsLibrary.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | C9B960E113CD2F1E13B17A07CE56CB3BD674F912 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | C9B960E113CD2F1E13B17A07CE56CB3BD674F912 36 | IDESourceControlWCCName 37 | VCTransitionsLibrary 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TabBarDemo 4 | // 5 | // Created by Colin Eberhardt on 17/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // TabBarDemo 4 | // 5 | // Created by Colin Eberhardt on 17/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo/Base.lproj/Main_iPad.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo/Base.lproj/Main_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. 25 | 26 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation . 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. 77 | 78 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation . 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. 109 | 110 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation . 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo/TabBarDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.scottlogic.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main_iPhone 29 | UIMainStoryboardFile~ipad 30 | Main_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo/TabBarDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo/TabBarViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarViewController.h 3 | // TabBarDemo 4 | // 5 | // Created by Colin Eberhardt on 18/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TabBarViewController : UITabBarController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo/TabBarViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarViewController.m 3 | // TabBarDemo 4 | // 5 | // Created by Colin Eberhardt on 18/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "TabBarViewController.h" 10 | #import "CEFoldAnimationController.h" 11 | #import "CEHorizontalSwipeInteractionController.h" 12 | 13 | @interface TabBarViewController () 14 | 15 | @end 16 | 17 | @implementation TabBarViewController { 18 | CEFoldAnimationController *_animationController; 19 | CEHorizontalSwipeInteractionController *_swipeInteractionController; 20 | } 21 | 22 | - (id)initWithCoder:(NSCoder *)aDecoder { 23 | if (self = [super initWithCoder:aDecoder]) { 24 | self.delegate = self; 25 | 26 | // create the interaction / animation controllers 27 | _swipeInteractionController = [CEHorizontalSwipeInteractionController new]; 28 | _animationController = [CEFoldAnimationController new]; 29 | _animationController.folds = 3; 30 | 31 | // observe changes in the currently presented view controller 32 | [self addObserver:self 33 | forKeyPath:@"selectedViewController" 34 | options:NSKeyValueObservingOptionNew 35 | context:nil]; 36 | } 37 | return self; 38 | } 39 | 40 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object 41 | change:(NSDictionary *)change 42 | context:(void *)context 43 | { 44 | if ([keyPath isEqualToString:@"selectedViewController"] ) 45 | { 46 | // wire the interaction controller to the view controller 47 | [_swipeInteractionController wireToViewController:self.selectedViewController 48 | forOperation:CEInteractionOperationTab]; 49 | } 50 | } 51 | 52 | 53 | 54 | - (id )tabBarController:(UITabBarController *)tabBarController 55 | animationControllerForTransitionFromViewController:(UIViewController *)fromVC 56 | toViewController:(UIViewController *)toVC { 57 | 58 | NSUInteger fromVCIndex = [tabBarController.viewControllers indexOfObject:fromVC]; 59 | NSUInteger toVCIndex = [tabBarController.viewControllers indexOfObject:toVC]; 60 | 61 | _animationController.reverse = fromVCIndex < toVCIndex; 62 | return _animationController; 63 | } 64 | 65 | -(id)tabBarController:(UITabBarController *)tabBarController interactionControllerForAnimationController:(id)animationController 66 | { 67 | return _swipeInteractionController.interactionInProgress ? _swipeInteractionController : nil; 68 | } 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // TabBarDemo 4 | // 5 | // Created by Colin Eberhardt on 17/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // TabBarDemo 4 | // 5 | // Created by Colin Eberhardt on 17/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TabBarDemo 4 | // 5 | // Created by Colin Eberhardt on 17/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemoTests/TabBarDemoTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.scottlogic.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemoTests/TabBarDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarDemoTests.m 3 | // TabBarDemoTests 4 | // 5 | // Created by Colin Eberhardt on 17/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TabBarDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation TabBarDemoTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /TabBarDemo/TabBarDemoTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3CD5090B189FFE6900BAE35A /* CECubeAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CD50909189FFE6900BAE35A /* CECubeAnimationController.m */; }; 11 | 7273232017DFBD4D0072C7FD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7273231F17DFBD4D0072C7FD /* Foundation.framework */; }; 12 | 7273232217DFBD4D0072C7FD /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7273232117DFBD4D0072C7FD /* CoreGraphics.framework */; }; 13 | 7273232417DFBD4D0072C7FD /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7273232317DFBD4D0072C7FD /* UIKit.framework */; }; 14 | 7273232A17DFBD4D0072C7FD /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7273232817DFBD4D0072C7FD /* InfoPlist.strings */; }; 15 | 7273232C17DFBD4D0072C7FD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7273232B17DFBD4D0072C7FD /* main.m */; }; 16 | 7273233017DFBD4D0072C7FD /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7273232F17DFBD4D0072C7FD /* AppDelegate.m */; }; 17 | 7273233317DFBD4D0072C7FD /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7273233117DFBD4D0072C7FD /* Main_iPhone.storyboard */; }; 18 | 7273233917DFBD4D0072C7FD /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7273233817DFBD4D0072C7FD /* ViewController.m */; }; 19 | 7273233B17DFBD4D0072C7FD /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7273233A17DFBD4D0072C7FD /* Images.xcassets */; }; 20 | 7273235F17DFBEBF0072C7FD /* CEFlipAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7273235B17DFBEBF0072C7FD /* CEFlipAnimationController.m */; }; 21 | 7273236017DFBEBF0072C7FD /* CETurnAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7273235D17DFBEBF0072C7FD /* CETurnAnimationController.m */; }; 22 | 7273236317DFBEFE0072C7FD /* CEReversibleAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7273236217DFBEFE0072C7FD /* CEReversibleAnimationController.m */; }; 23 | 7273236917DFBF140072C7FD /* CEBaseInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7273236617DFBF140072C7FD /* CEBaseInteractionController.m */; }; 24 | 7273236A17DFBF140072C7FD /* CEHorizontalSwipeInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7273236817DFBF140072C7FD /* CEHorizontalSwipeInteractionController.m */; }; 25 | 7273236D17DFC0690072C7FD /* NavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7273236C17DFC0690072C7FD /* NavigationController.m */; }; 26 | 7273237017DFC4710072C7FD /* SettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7273236F17DFC4710072C7FD /* SettingsViewController.m */; }; 27 | 72B92C661856FE98001A2D84 /* CEPortalAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B92C651856FE98001A2D84 /* CEPortalAnimationController.m */; }; 28 | 72C15E1117E10C620056B3F9 /* CECrossfadeAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72C15E1017E10C620056B3F9 /* CECrossfadeAnimationController.m */; }; 29 | 72C15E1417E10E7B0056B3F9 /* CEExplodeAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72C15E1317E10E7B0056B3F9 /* CEExplodeAnimationController.m */; }; 30 | 72C15E1717E19A940056B3F9 /* CEFoldAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72C15E1617E19A940056B3F9 /* CEFoldAnimationController.m */; }; 31 | 72EC05A917E7B1BE00DCB9A3 /* CEPinchInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72EC05A817E7B1BE00DCB9A3 /* CEPinchInteractionController.m */; }; 32 | 72EE96D817EF47A60097DF82 /* CECardsAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72EE96D717EF47A60097DF82 /* CECardsAnimationController.m */; }; 33 | 72EE96DB17EF66040097DF82 /* CEVerticalSwipeInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72EE96DA17EF66040097DF82 /* CEVerticalSwipeInteractionController.m */; }; 34 | 7D0D046C1816DBA700F289A6 /* CENatGeoAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D0D046B1816DBA700F289A6 /* CENatGeoAnimationController.m */; }; 35 | A993F2801B80832400553FBD /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A993F27E1B80832400553FBD /* Launch Screen.storyboard */; }; 36 | BC46683B198B2E6700A07DF8 /* CEPanAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC46683A198B2E6700A07DF8 /* CEPanAnimationController.m */; }; 37 | /* End PBXBuildFile section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 3CD50909189FFE6900BAE35A /* CECubeAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CECubeAnimationController.m; sourceTree = ""; }; 41 | 3CD5090A189FFE6900BAE35A /* CECubeAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CECubeAnimationController.h; sourceTree = ""; }; 42 | 7273231C17DFBD4D0072C7FD /* TransitionsDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TransitionsDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 7273231F17DFBD4D0072C7FD /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 44 | 7273232117DFBD4D0072C7FD /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 45 | 7273232317DFBD4D0072C7FD /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 46 | 7273232717DFBD4D0072C7FD /* TransitionsDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TransitionsDemo-Info.plist"; sourceTree = ""; }; 47 | 7273232917DFBD4D0072C7FD /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 48 | 7273232B17DFBD4D0072C7FD /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 49 | 7273232D17DFBD4D0072C7FD /* TransitionsDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TransitionsDemo-Prefix.pch"; sourceTree = ""; }; 50 | 7273232E17DFBD4D0072C7FD /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 51 | 7273232F17DFBD4D0072C7FD /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 52 | 7273233217DFBD4D0072C7FD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = ""; }; 53 | 7273233717DFBD4D0072C7FD /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 54 | 7273233817DFBD4D0072C7FD /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 55 | 7273233A17DFBD4D0072C7FD /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 56 | 7273234117DFBD4D0072C7FD /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 57 | 7273235A17DFBEBF0072C7FD /* CEFlipAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEFlipAnimationController.h; sourceTree = ""; }; 58 | 7273235B17DFBEBF0072C7FD /* CEFlipAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEFlipAnimationController.m; sourceTree = ""; }; 59 | 7273235C17DFBEBF0072C7FD /* CETurnAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CETurnAnimationController.h; sourceTree = ""; }; 60 | 7273235D17DFBEBF0072C7FD /* CETurnAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CETurnAnimationController.m; sourceTree = ""; }; 61 | 7273236117DFBEFE0072C7FD /* CEReversibleAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEReversibleAnimationController.h; sourceTree = ""; }; 62 | 7273236217DFBEFE0072C7FD /* CEReversibleAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEReversibleAnimationController.m; sourceTree = ""; }; 63 | 7273236517DFBF140072C7FD /* CEBaseInteractionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEBaseInteractionController.h; sourceTree = ""; }; 64 | 7273236617DFBF140072C7FD /* CEBaseInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEBaseInteractionController.m; sourceTree = ""; }; 65 | 7273236717DFBF140072C7FD /* CEHorizontalSwipeInteractionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEHorizontalSwipeInteractionController.h; sourceTree = ""; }; 66 | 7273236817DFBF140072C7FD /* CEHorizontalSwipeInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEHorizontalSwipeInteractionController.m; sourceTree = ""; }; 67 | 7273236B17DFC0690072C7FD /* NavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigationController.h; sourceTree = ""; }; 68 | 7273236C17DFC0690072C7FD /* NavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NavigationController.m; sourceTree = ""; }; 69 | 7273236E17DFC4710072C7FD /* SettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsViewController.h; sourceTree = ""; }; 70 | 7273236F17DFC4710072C7FD /* SettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsViewController.m; sourceTree = ""; }; 71 | 72B92C641856FE98001A2D84 /* CEPortalAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEPortalAnimationController.h; sourceTree = ""; }; 72 | 72B92C651856FE98001A2D84 /* CEPortalAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEPortalAnimationController.m; sourceTree = ""; }; 73 | 72C15E0F17E10C620056B3F9 /* CECrossfadeAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CECrossfadeAnimationController.h; sourceTree = ""; }; 74 | 72C15E1017E10C620056B3F9 /* CECrossfadeAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CECrossfadeAnimationController.m; sourceTree = ""; }; 75 | 72C15E1217E10E7B0056B3F9 /* CEExplodeAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEExplodeAnimationController.h; sourceTree = ""; }; 76 | 72C15E1317E10E7B0056B3F9 /* CEExplodeAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEExplodeAnimationController.m; sourceTree = ""; }; 77 | 72C15E1517E19A940056B3F9 /* CEFoldAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEFoldAnimationController.h; sourceTree = ""; }; 78 | 72C15E1617E19A940056B3F9 /* CEFoldAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEFoldAnimationController.m; sourceTree = ""; }; 79 | 72EC05A717E7B1BE00DCB9A3 /* CEPinchInteractionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEPinchInteractionController.h; sourceTree = ""; }; 80 | 72EC05A817E7B1BE00DCB9A3 /* CEPinchInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEPinchInteractionController.m; sourceTree = ""; }; 81 | 72EE96D617EF47A60097DF82 /* CECardsAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CECardsAnimationController.h; sourceTree = ""; }; 82 | 72EE96D717EF47A60097DF82 /* CECardsAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CECardsAnimationController.m; sourceTree = ""; }; 83 | 72EE96D917EF66040097DF82 /* CEVerticalSwipeInteractionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEVerticalSwipeInteractionController.h; sourceTree = ""; }; 84 | 72EE96DA17EF66040097DF82 /* CEVerticalSwipeInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEVerticalSwipeInteractionController.m; sourceTree = ""; }; 85 | 7D0D046A1816DBA700F289A6 /* CENatGeoAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CENatGeoAnimationController.h; sourceTree = ""; }; 86 | 7D0D046B1816DBA700F289A6 /* CENatGeoAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CENatGeoAnimationController.m; sourceTree = ""; }; 87 | A993F27F1B80832400553FBD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = "Base.lproj/Launch Screen.storyboard"; sourceTree = ""; }; 88 | BC466839198B2E6700A07DF8 /* CEPanAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEPanAnimationController.h; sourceTree = ""; }; 89 | BC46683A198B2E6700A07DF8 /* CEPanAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEPanAnimationController.m; sourceTree = ""; }; 90 | /* End PBXFileReference section */ 91 | 92 | /* Begin PBXFrameworksBuildPhase section */ 93 | 7273231917DFBD4D0072C7FD /* Frameworks */ = { 94 | isa = PBXFrameworksBuildPhase; 95 | buildActionMask = 2147483647; 96 | files = ( 97 | 7273232217DFBD4D0072C7FD /* CoreGraphics.framework in Frameworks */, 98 | 7273232417DFBD4D0072C7FD /* UIKit.framework in Frameworks */, 99 | 7273232017DFBD4D0072C7FD /* Foundation.framework in Frameworks */, 100 | ); 101 | runOnlyForDeploymentPostprocessing = 0; 102 | }; 103 | /* End PBXFrameworksBuildPhase section */ 104 | 105 | /* Begin PBXGroup section */ 106 | 7273231317DFBD4D0072C7FD = { 107 | isa = PBXGroup; 108 | children = ( 109 | 7273236417DFBF140072C7FD /* InteractionControllers */, 110 | 7273235717DFBEBF0072C7FD /* AnimationControllers */, 111 | 7273232517DFBD4D0072C7FD /* TransitionsDemo */, 112 | 7273231E17DFBD4D0072C7FD /* Frameworks */, 113 | 7273231D17DFBD4D0072C7FD /* Products */, 114 | ); 115 | sourceTree = ""; 116 | }; 117 | 7273231D17DFBD4D0072C7FD /* Products */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 7273231C17DFBD4D0072C7FD /* TransitionsDemo.app */, 121 | ); 122 | name = Products; 123 | sourceTree = ""; 124 | }; 125 | 7273231E17DFBD4D0072C7FD /* Frameworks */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 7273231F17DFBD4D0072C7FD /* Foundation.framework */, 129 | 7273232117DFBD4D0072C7FD /* CoreGraphics.framework */, 130 | 7273232317DFBD4D0072C7FD /* UIKit.framework */, 131 | 7273234117DFBD4D0072C7FD /* XCTest.framework */, 132 | ); 133 | name = Frameworks; 134 | sourceTree = ""; 135 | }; 136 | 7273232517DFBD4D0072C7FD /* TransitionsDemo */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 7273232E17DFBD4D0072C7FD /* AppDelegate.h */, 140 | 7273232F17DFBD4D0072C7FD /* AppDelegate.m */, 141 | A993F27E1B80832400553FBD /* Launch Screen.storyboard */, 142 | 7273233117DFBD4D0072C7FD /* Main_iPhone.storyboard */, 143 | 7273233717DFBD4D0072C7FD /* ViewController.h */, 144 | 7273233817DFBD4D0072C7FD /* ViewController.m */, 145 | 7273233A17DFBD4D0072C7FD /* Images.xcassets */, 146 | 7273232617DFBD4D0072C7FD /* Supporting Files */, 147 | 7273236B17DFC0690072C7FD /* NavigationController.h */, 148 | 7273236C17DFC0690072C7FD /* NavigationController.m */, 149 | 7273236E17DFC4710072C7FD /* SettingsViewController.h */, 150 | 7273236F17DFC4710072C7FD /* SettingsViewController.m */, 151 | ); 152 | path = TransitionsDemo; 153 | sourceTree = ""; 154 | }; 155 | 7273232617DFBD4D0072C7FD /* Supporting Files */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | 7273232717DFBD4D0072C7FD /* TransitionsDemo-Info.plist */, 159 | 7273232817DFBD4D0072C7FD /* InfoPlist.strings */, 160 | 7273232B17DFBD4D0072C7FD /* main.m */, 161 | 7273232D17DFBD4D0072C7FD /* TransitionsDemo-Prefix.pch */, 162 | ); 163 | name = "Supporting Files"; 164 | sourceTree = ""; 165 | }; 166 | 7273235717DFBEBF0072C7FD /* AnimationControllers */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | BC466839198B2E6700A07DF8 /* CEPanAnimationController.h */, 170 | BC46683A198B2E6700A07DF8 /* CEPanAnimationController.m */, 171 | 3CD5090A189FFE6900BAE35A /* CECubeAnimationController.h */, 172 | 3CD50909189FFE6900BAE35A /* CECubeAnimationController.m */, 173 | 72B92C641856FE98001A2D84 /* CEPortalAnimationController.h */, 174 | 72B92C651856FE98001A2D84 /* CEPortalAnimationController.m */, 175 | 7273236117DFBEFE0072C7FD /* CEReversibleAnimationController.h */, 176 | 7273236217DFBEFE0072C7FD /* CEReversibleAnimationController.m */, 177 | 7273235A17DFBEBF0072C7FD /* CEFlipAnimationController.h */, 178 | 7273235B17DFBEBF0072C7FD /* CEFlipAnimationController.m */, 179 | 7273235C17DFBEBF0072C7FD /* CETurnAnimationController.h */, 180 | 7273235D17DFBEBF0072C7FD /* CETurnAnimationController.m */, 181 | 72C15E0F17E10C620056B3F9 /* CECrossfadeAnimationController.h */, 182 | 72C15E1017E10C620056B3F9 /* CECrossfadeAnimationController.m */, 183 | 72C15E1217E10E7B0056B3F9 /* CEExplodeAnimationController.h */, 184 | 72C15E1317E10E7B0056B3F9 /* CEExplodeAnimationController.m */, 185 | 72C15E1517E19A940056B3F9 /* CEFoldAnimationController.h */, 186 | 72C15E1617E19A940056B3F9 /* CEFoldAnimationController.m */, 187 | 72EE96D617EF47A60097DF82 /* CECardsAnimationController.h */, 188 | 72EE96D717EF47A60097DF82 /* CECardsAnimationController.m */, 189 | 7D0D046A1816DBA700F289A6 /* CENatGeoAnimationController.h */, 190 | 7D0D046B1816DBA700F289A6 /* CENatGeoAnimationController.m */, 191 | ); 192 | name = AnimationControllers; 193 | path = ../AnimationControllers; 194 | sourceTree = ""; 195 | }; 196 | 7273236417DFBF140072C7FD /* InteractionControllers */ = { 197 | isa = PBXGroup; 198 | children = ( 199 | 7273236517DFBF140072C7FD /* CEBaseInteractionController.h */, 200 | 7273236617DFBF140072C7FD /* CEBaseInteractionController.m */, 201 | 7273236717DFBF140072C7FD /* CEHorizontalSwipeInteractionController.h */, 202 | 7273236817DFBF140072C7FD /* CEHorizontalSwipeInteractionController.m */, 203 | 72EC05A717E7B1BE00DCB9A3 /* CEPinchInteractionController.h */, 204 | 72EC05A817E7B1BE00DCB9A3 /* CEPinchInteractionController.m */, 205 | 72EE96D917EF66040097DF82 /* CEVerticalSwipeInteractionController.h */, 206 | 72EE96DA17EF66040097DF82 /* CEVerticalSwipeInteractionController.m */, 207 | ); 208 | name = InteractionControllers; 209 | path = ../InteractionControllers; 210 | sourceTree = ""; 211 | }; 212 | /* End PBXGroup section */ 213 | 214 | /* Begin PBXNativeTarget section */ 215 | 7273231B17DFBD4D0072C7FD /* TransitionsDemo */ = { 216 | isa = PBXNativeTarget; 217 | buildConfigurationList = 7273235117DFBD4D0072C7FD /* Build configuration list for PBXNativeTarget "TransitionsDemo" */; 218 | buildPhases = ( 219 | 7273231817DFBD4D0072C7FD /* Sources */, 220 | 7273231917DFBD4D0072C7FD /* Frameworks */, 221 | 7273231A17DFBD4D0072C7FD /* Resources */, 222 | ); 223 | buildRules = ( 224 | ); 225 | dependencies = ( 226 | ); 227 | name = TransitionsDemo; 228 | productName = TransitionsDemo; 229 | productReference = 7273231C17DFBD4D0072C7FD /* TransitionsDemo.app */; 230 | productType = "com.apple.product-type.application"; 231 | }; 232 | /* End PBXNativeTarget section */ 233 | 234 | /* Begin PBXProject section */ 235 | 7273231417DFBD4D0072C7FD /* Project object */ = { 236 | isa = PBXProject; 237 | attributes = { 238 | LastUpgradeCheck = 0500; 239 | ORGANIZATIONNAME = "Colin Eberhardt"; 240 | }; 241 | buildConfigurationList = 7273231717DFBD4D0072C7FD /* Build configuration list for PBXProject "TransitionsDemo" */; 242 | compatibilityVersion = "Xcode 3.2"; 243 | developmentRegion = English; 244 | hasScannedForEncodings = 0; 245 | knownRegions = ( 246 | en, 247 | Base, 248 | ); 249 | mainGroup = 7273231317DFBD4D0072C7FD; 250 | productRefGroup = 7273231D17DFBD4D0072C7FD /* Products */; 251 | projectDirPath = ""; 252 | projectRoot = ""; 253 | targets = ( 254 | 7273231B17DFBD4D0072C7FD /* TransitionsDemo */, 255 | ); 256 | }; 257 | /* End PBXProject section */ 258 | 259 | /* Begin PBXResourcesBuildPhase section */ 260 | 7273231A17DFBD4D0072C7FD /* Resources */ = { 261 | isa = PBXResourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | 7273233B17DFBD4D0072C7FD /* Images.xcassets in Resources */, 265 | 7273233317DFBD4D0072C7FD /* Main_iPhone.storyboard in Resources */, 266 | A993F2801B80832400553FBD /* Launch Screen.storyboard in Resources */, 267 | 7273232A17DFBD4D0072C7FD /* InfoPlist.strings in Resources */, 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | }; 271 | /* End PBXResourcesBuildPhase section */ 272 | 273 | /* Begin PBXSourcesBuildPhase section */ 274 | 7273231817DFBD4D0072C7FD /* Sources */ = { 275 | isa = PBXSourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | 7273236917DFBF140072C7FD /* CEBaseInteractionController.m in Sources */, 279 | 7273233917DFBD4D0072C7FD /* ViewController.m in Sources */, 280 | 72B92C661856FE98001A2D84 /* CEPortalAnimationController.m in Sources */, 281 | 72C15E1717E19A940056B3F9 /* CEFoldAnimationController.m in Sources */, 282 | 72C15E1417E10E7B0056B3F9 /* CEExplodeAnimationController.m in Sources */, 283 | 72C15E1117E10C620056B3F9 /* CECrossfadeAnimationController.m in Sources */, 284 | 72EC05A917E7B1BE00DCB9A3 /* CEPinchInteractionController.m in Sources */, 285 | 7273233017DFBD4D0072C7FD /* AppDelegate.m in Sources */, 286 | 7273232C17DFBD4D0072C7FD /* main.m in Sources */, 287 | 7273236017DFBEBF0072C7FD /* CETurnAnimationController.m in Sources */, 288 | 7273236A17DFBF140072C7FD /* CEHorizontalSwipeInteractionController.m in Sources */, 289 | 7D0D046C1816DBA700F289A6 /* CENatGeoAnimationController.m in Sources */, 290 | 7273236D17DFC0690072C7FD /* NavigationController.m in Sources */, 291 | 7273237017DFC4710072C7FD /* SettingsViewController.m in Sources */, 292 | 3CD5090B189FFE6900BAE35A /* CECubeAnimationController.m in Sources */, 293 | 72EE96DB17EF66040097DF82 /* CEVerticalSwipeInteractionController.m in Sources */, 294 | 7273235F17DFBEBF0072C7FD /* CEFlipAnimationController.m in Sources */, 295 | 7273236317DFBEFE0072C7FD /* CEReversibleAnimationController.m in Sources */, 296 | 72EE96D817EF47A60097DF82 /* CECardsAnimationController.m in Sources */, 297 | BC46683B198B2E6700A07DF8 /* CEPanAnimationController.m in Sources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | /* End PBXSourcesBuildPhase section */ 302 | 303 | /* Begin PBXVariantGroup section */ 304 | 7273232817DFBD4D0072C7FD /* InfoPlist.strings */ = { 305 | isa = PBXVariantGroup; 306 | children = ( 307 | 7273232917DFBD4D0072C7FD /* en */, 308 | ); 309 | name = InfoPlist.strings; 310 | sourceTree = ""; 311 | }; 312 | 7273233117DFBD4D0072C7FD /* Main_iPhone.storyboard */ = { 313 | isa = PBXVariantGroup; 314 | children = ( 315 | 7273233217DFBD4D0072C7FD /* Base */, 316 | ); 317 | name = Main_iPhone.storyboard; 318 | sourceTree = ""; 319 | }; 320 | A993F27E1B80832400553FBD /* Launch Screen.storyboard */ = { 321 | isa = PBXVariantGroup; 322 | children = ( 323 | A993F27F1B80832400553FBD /* Base */, 324 | ); 325 | name = "Launch Screen.storyboard"; 326 | sourceTree = ""; 327 | }; 328 | /* End PBXVariantGroup section */ 329 | 330 | /* Begin XCBuildConfiguration section */ 331 | 7273234F17DFBD4D0072C7FD /* Debug */ = { 332 | isa = XCBuildConfiguration; 333 | buildSettings = { 334 | ALWAYS_SEARCH_USER_PATHS = NO; 335 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 336 | CLANG_CXX_LIBRARY = "libc++"; 337 | CLANG_ENABLE_MODULES = YES; 338 | CLANG_ENABLE_OBJC_ARC = YES; 339 | CLANG_WARN_BOOL_CONVERSION = YES; 340 | CLANG_WARN_CONSTANT_CONVERSION = YES; 341 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 342 | CLANG_WARN_EMPTY_BODY = YES; 343 | CLANG_WARN_ENUM_CONVERSION = YES; 344 | CLANG_WARN_INT_CONVERSION = YES; 345 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 348 | COPY_PHASE_STRIP = NO; 349 | GCC_C_LANGUAGE_STANDARD = gnu99; 350 | GCC_DYNAMIC_NO_PIC = NO; 351 | GCC_OPTIMIZATION_LEVEL = 0; 352 | GCC_PREPROCESSOR_DEFINITIONS = ( 353 | "DEBUG=1", 354 | "$(inherited)", 355 | ); 356 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 357 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 358 | GCC_WARN_UNDECLARED_SELECTOR = YES; 359 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 360 | GCC_WARN_UNUSED_FUNCTION = YES; 361 | GCC_WARN_UNUSED_VARIABLE = YES; 362 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 363 | ONLY_ACTIVE_ARCH = YES; 364 | SDKROOT = iphoneos; 365 | TARGETED_DEVICE_FAMILY = "1,2"; 366 | }; 367 | name = Debug; 368 | }; 369 | 7273235017DFBD4D0072C7FD /* Release */ = { 370 | isa = XCBuildConfiguration; 371 | buildSettings = { 372 | ALWAYS_SEARCH_USER_PATHS = NO; 373 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 374 | CLANG_CXX_LIBRARY = "libc++"; 375 | CLANG_ENABLE_MODULES = YES; 376 | CLANG_ENABLE_OBJC_ARC = YES; 377 | CLANG_WARN_BOOL_CONVERSION = YES; 378 | CLANG_WARN_CONSTANT_CONVERSION = YES; 379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 380 | CLANG_WARN_EMPTY_BODY = YES; 381 | CLANG_WARN_ENUM_CONVERSION = YES; 382 | CLANG_WARN_INT_CONVERSION = YES; 383 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 384 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 385 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 386 | COPY_PHASE_STRIP = YES; 387 | ENABLE_NS_ASSERTIONS = NO; 388 | GCC_C_LANGUAGE_STANDARD = gnu99; 389 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 390 | GCC_WARN_UNDECLARED_SELECTOR = YES; 391 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 392 | GCC_WARN_UNUSED_FUNCTION = YES; 393 | GCC_WARN_UNUSED_VARIABLE = YES; 394 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 395 | SDKROOT = iphoneos; 396 | TARGETED_DEVICE_FAMILY = "1,2"; 397 | VALIDATE_PRODUCT = YES; 398 | }; 399 | name = Release; 400 | }; 401 | 7273235217DFBD4D0072C7FD /* Debug */ = { 402 | isa = XCBuildConfiguration; 403 | buildSettings = { 404 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 405 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 406 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 407 | GCC_PREFIX_HEADER = "TransitionsDemo/TransitionsDemo-Prefix.pch"; 408 | INFOPLIST_FILE = "TransitionsDemo/TransitionsDemo-Info.plist"; 409 | PRODUCT_NAME = "$(TARGET_NAME)"; 410 | WRAPPER_EXTENSION = app; 411 | }; 412 | name = Debug; 413 | }; 414 | 7273235317DFBD4D0072C7FD /* Release */ = { 415 | isa = XCBuildConfiguration; 416 | buildSettings = { 417 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 418 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 419 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 420 | GCC_PREFIX_HEADER = "TransitionsDemo/TransitionsDemo-Prefix.pch"; 421 | INFOPLIST_FILE = "TransitionsDemo/TransitionsDemo-Info.plist"; 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | WRAPPER_EXTENSION = app; 424 | }; 425 | name = Release; 426 | }; 427 | /* End XCBuildConfiguration section */ 428 | 429 | /* Begin XCConfigurationList section */ 430 | 7273231717DFBD4D0072C7FD /* Build configuration list for PBXProject "TransitionsDemo" */ = { 431 | isa = XCConfigurationList; 432 | buildConfigurations = ( 433 | 7273234F17DFBD4D0072C7FD /* Debug */, 434 | 7273235017DFBD4D0072C7FD /* Release */, 435 | ); 436 | defaultConfigurationIsVisible = 0; 437 | defaultConfigurationName = Release; 438 | }; 439 | 7273235117DFBD4D0072C7FD /* Build configuration list for PBXNativeTarget "TransitionsDemo" */ = { 440 | isa = XCConfigurationList; 441 | buildConfigurations = ( 442 | 7273235217DFBD4D0072C7FD /* Debug */, 443 | 7273235317DFBD4D0072C7FD /* Release */, 444 | ); 445 | defaultConfigurationIsVisible = 0; 446 | defaultConfigurationName = Release; 447 | }; 448 | /* End XCConfigurationList section */ 449 | }; 450 | rootObject = 7273231417DFBD4D0072C7FD /* Project object */; 451 | } 452 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 10/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // a macro for easy access to the singleton app-delegate. Yes, I know some people 12 | // consider the an anti-pattern, but this is just a simple test app, so let's 13 | // not stress about it? ;-) 14 | #define AppDelegateAccessor ((AppDelegate *)[[UIApplication sharedApplication] delegate]) 15 | 16 | @class CEReversibleAnimationController, CEBaseInteractionController; 17 | 18 | @interface AppDelegate : UIResponder 19 | 20 | @property (strong, nonatomic) UIWindow *window; 21 | 22 | @property (strong, nonatomic) CEReversibleAnimationController *settingsAnimationController; 23 | @property (strong, nonatomic) CEReversibleAnimationController *navigationControllerAnimationController; 24 | @property (strong, nonatomic) CEBaseInteractionController *navigationControllerInteractionController; 25 | @property (strong, nonatomic) CEBaseInteractionController *settingsInteractionController; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 10/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "CECardsAnimationController.h" 11 | #import "CEVerticalSwipeInteractionController.h" 12 | 13 | @implementation AppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | //AppDelegateAccessor.navigationControllerAnimationController = [CECardsAnimationController new]; 18 | //AppDelegateAccessor.navigationControllerInteractionController = [CEVerticalSwipeInteactionController new]; 19 | return YES; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/Base.lproj/Launch Screen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/Base.lproj/Main_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. 42 | 43 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. 44 | 45 | 46 | 47 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/NavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NavigationControllerViewController.h 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 10/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NavigationController : UINavigationController 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/NavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MyNavigationControllerViewController.m 3 | // ViewControllerTransitions 4 | // 5 | // Created by Colin Eberhardt on 09/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "NavigationController.h" 10 | #import "AppDelegate.h" 11 | #import "CEBaseInteractionController.h" 12 | #import "CEReversibleAnimationController.h" 13 | 14 | @interface NavigationController () 15 | 16 | @end 17 | 18 | @implementation NavigationController 19 | 20 | - (id)initWithCoder:(NSCoder *)aDecoder { 21 | if (self = [super initWithCoder:aDecoder]) { 22 | self.delegate = self; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { 28 | 29 | [self wirePopInteractionControllerTo:viewController]; 30 | } 31 | 32 | - (void)wirePopInteractionControllerTo:(UIViewController *)viewController 33 | { 34 | // when a push occurs, wire the interaction controller to the to- view controller 35 | if (!AppDelegateAccessor.navigationControllerInteractionController) { 36 | return; 37 | } 38 | 39 | [AppDelegateAccessor.navigationControllerInteractionController wireToViewController:viewController forOperation:CEInteractionOperationPop]; 40 | } 41 | 42 | 43 | - (id)navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC { 44 | 45 | if (AppDelegateAccessor.navigationControllerAnimationController) { 46 | AppDelegateAccessor.navigationControllerAnimationController.reverse = operation == UINavigationControllerOperationPop; 47 | } 48 | 49 | return AppDelegateAccessor.navigationControllerAnimationController; 50 | } 51 | 52 | - (id )navigationController:(UINavigationController *)navigationController interactionControllerForAnimationController:(id ) animationController { 53 | 54 | // if we have an interaction controller - and it is currently in progress, return it 55 | return AppDelegateAccessor.navigationControllerInteractionController && AppDelegateAccessor.navigationControllerInteractionController.interactionInProgress ? AppDelegateAccessor.navigationControllerInteractionController : nil; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/SettingsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsViewController.h 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 10/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SettingsViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/SettingsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsViewController.m 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 10/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "SettingsViewController.h" 10 | #import "NavigationController.h" 11 | #import "CEBaseInteractionController.h" 12 | #import "AppDelegate.h" 13 | #import "CEReversibleAnimationController.h" 14 | 15 | @interface SettingsViewController () 16 | 17 | @end 18 | 19 | @implementation SettingsViewController { 20 | NSArray *_animationControllers; 21 | NSArray *_interactionControllers; 22 | } 23 | 24 | - (id)initWithCoder:(NSCoder *)aDecoder { 25 | if (self = [super initWithCoder:aDecoder]) { 26 | _animationControllers = @[@"None", @"Portal", @"Cards", @"Fold", @"Explode", @"Flip", @"Turn", @"Crossfade", @"NatGeo", @"Cube",@"Pan"]; 27 | _interactionControllers = @[@"None", @"HorizontalSwipe" ,@"VerticalSwipe", @"Pinch"]; 28 | } 29 | return self; 30 | } 31 | 32 | - (IBAction)doneButtonPressed:(id)sender { 33 | [self dismissViewControllerAnimated:YES completion:nil]; 34 | } 35 | 36 | - (NSString *)classToTransitionName:(NSObject *)instance { 37 | 38 | if (!instance) 39 | return @"None"; 40 | 41 | NSString *animationClass = NSStringFromClass(instance.class); 42 | 43 | NSMutableString *transitionName = [[NSMutableString alloc] initWithString:animationClass]; 44 | [transitionName replaceOccurrencesOfString:@"CE" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, transitionName.length)]; 45 | [transitionName replaceOccurrencesOfString:@"AnimationController" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, transitionName.length)]; 46 | [transitionName replaceOccurrencesOfString:@"InteractionController" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, transitionName.length)]; 47 | 48 | return transitionName; 49 | } 50 | 51 | - (id)transitionNameToInstance:(NSString *)transitionName { 52 | NSString *className = [NSString stringWithFormat:@"CE%@AnimationController", transitionName]; 53 | return [[NSClassFromString(className) alloc] init]; 54 | } 55 | 56 | #pragma mark - UITableViewDelegate methods 57 | 58 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 59 | if (indexPath.section < 2) { 60 | // an animation controller was selected 61 | NSString* transitionName = _animationControllers[indexPath.row]; 62 | NSString *className = [NSString stringWithFormat:@"CE%@AnimationController", transitionName]; 63 | id transitionInstance = [[NSClassFromString(className) alloc] init]; 64 | 65 | if (indexPath.section == 0) { 66 | AppDelegateAccessor.navigationControllerAnimationController = transitionInstance; 67 | } 68 | if (indexPath.section == 1) { 69 | AppDelegateAccessor.settingsAnimationController = transitionInstance; 70 | } 71 | } else { 72 | // an interaction cntroller was selected 73 | NSString* transitionName = _interactionControllers[indexPath.row]; 74 | NSString *className = [NSString stringWithFormat:@"CE%@InteractionController", transitionName]; 75 | id transitionInstance = [[NSClassFromString(className) alloc] init]; 76 | 77 | if (indexPath.section == 2) { 78 | AppDelegateAccessor.navigationControllerInteractionController = transitionInstance; 79 | } 80 | if (indexPath.section == 3) { 81 | AppDelegateAccessor.settingsInteractionController = transitionInstance; 82 | } 83 | } 84 | [self.tableView reloadData]; 85 | } 86 | 87 | - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { 88 | 89 | // get the cell text 90 | NSString *transitionName = cell.textLabel.text; 91 | NSObject *currentTransition; 92 | 93 | // get the current animation / interaction controller 94 | if (indexPath.section < 2) { 95 | currentTransition = indexPath.section == 0 ? 96 | AppDelegateAccessor.navigationControllerAnimationController : 97 | AppDelegateAccessor.settingsAnimationController; 98 | } else { 99 | currentTransition = indexPath.section == 2 ? 100 | AppDelegateAccessor.navigationControllerInteractionController : 101 | AppDelegateAccessor.settingsInteractionController; 102 | } 103 | 104 | // if they match - render a tick 105 | NSString *transitionClassName = [self classToTransitionName:currentTransition]; 106 | cell.accessoryType = [transitionName isEqualToString:transitionClassName] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; 107 | 108 | } 109 | 110 | #pragma mark - UITableViewDatasource methods 111 | 112 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 113 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; 114 | 115 | if (indexPath.section < 2) { 116 | cell.textLabel.text = _animationControllers[indexPath.row]; 117 | } else { 118 | cell.textLabel.text = _interactionControllers[indexPath.row]; 119 | } 120 | return cell; 121 | } 122 | 123 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 124 | return section < 2 ? _animationControllers.count : _interactionControllers.count; 125 | } 126 | 127 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 128 | return 4; 129 | } 130 | 131 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 132 | if (section == 0) 133 | return @"Navigation push / pop animation controller"; 134 | 135 | if (section == 1) 136 | return @"Settings present / dismiss animation controller"; 137 | 138 | if (section == 2) 139 | return @"Navigation push / pop interaction controller"; 140 | 141 | if (section == 3) 142 | return @"Settings present / dismiss interaction controller"; 143 | 144 | return @""; 145 | } 146 | 147 | @end 148 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/TransitionsDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.scottlogic.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | Launch Screen 29 | UIMainStoryboardFile 30 | Main_iPhone 31 | UIMainStoryboardFile~ipad 32 | Main_iPhone 33 | UIRequiredDeviceCapabilities 34 | 35 | armv7 36 | 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationLandscapeLeft 41 | UIInterfaceOrientationLandscapeRight 42 | 43 | UISupportedInterfaceOrientations~ipad 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationPortraitUpsideDown 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/TransitionsDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 10/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CEReversibleAnimationController.h" 11 | 12 | @interface ViewController : UIViewController 13 | 14 | @property (nonatomic, strong) CEReversibleAnimationController *settingsAnimationController; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ViewControllerTransitions 4 | // 5 | // Created by Colin Eberhardt on 08/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "AppDelegate.h" 11 | #import "CEBaseInteractionController.h" 12 | 13 | @interface ViewController () 14 | 15 | @end 16 | 17 | static int colorIndex = 0; 18 | 19 | @implementation ViewController { 20 | NSArray* _colors; 21 | } 22 | 23 | - (void)viewDidLoad 24 | { 25 | [super viewDidLoad]; 26 | 27 | 28 | _colors = @[[UIColor redColor], 29 | [UIColor orangeColor], 30 | [UIColor yellowColor], 31 | [UIColor greenColor], 32 | [UIColor blueColor], 33 | [UIColor purpleColor]]; 34 | 35 | self.view.backgroundColor = _colors[colorIndex]; 36 | 37 | colorIndex = (colorIndex + 1) % _colors.count; 38 | } 39 | 40 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 41 | 42 | if ([segue.identifier isEqualToString:@"ShowSettings"]) { 43 | UIViewController *toVC = segue.destinationViewController; 44 | toVC.transitioningDelegate = self; 45 | } 46 | 47 | [super prepareForSegue:segue sender:sender]; 48 | } 49 | 50 | #pragma mark - UIViewControllerTransitioningDelegate 51 | 52 | - (id)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source { 53 | 54 | if (AppDelegateAccessor.settingsInteractionController) { 55 | [AppDelegateAccessor.settingsInteractionController wireToViewController:presented forOperation:CEInteractionOperationDismiss]; 56 | } 57 | 58 | AppDelegateAccessor.settingsAnimationController.reverse = NO; 59 | return AppDelegateAccessor.settingsAnimationController; 60 | } 61 | 62 | - (id)animationControllerForDismissedController:(UIViewController *)dismissed { 63 | AppDelegateAccessor.settingsAnimationController.reverse = YES; 64 | return AppDelegateAccessor.settingsAnimationController; 65 | } 66 | 67 | - (id)interactionControllerForDismissal:(id)animator { 68 | return AppDelegateAccessor.settingsInteractionController && AppDelegateAccessor.settingsInteractionController.interactionInProgress ? AppDelegateAccessor.settingsInteractionController : nil; 69 | } 70 | 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /TransitionsDemo/TransitionsDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TransitionsDemo 4 | // 5 | // Created by Colin Eberhardt on 10/09/2013. 6 | // Copyright (c) 2013 Colin Eberhardt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /VCTransitionsLibrary.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'VCTransitionsLibrary' 3 | s.version = '1.5.0' 4 | s.summary = 'A collection of interactive iOS 7 custom transitions, including flip, fold, cross-fade and more' 5 | s.author = { 6 | 'Colin Eberhardt' => 'colin.eberhardt@gmail.com' 7 | } 8 | s.source = { 9 | :git => 'https://github.com/ColinEberhardt/VCTransitionsLibrary.git', 10 | :tag => '1.5.0' 11 | } 12 | s.license = { 13 | :type => 'MIT', 14 | :file => 'MIT-LICENSE.txt' 15 | } 16 | s.source_files = 'AnimationControllers/*.{h,m}', 'InteractionControllers/*.{h,m}' 17 | s.homepage = 'https://github.com/ColinEberhardt/VCTransitionsLibrary' 18 | s.requires_arc = true 19 | end 20 | --------------------------------------------------------------------------------