├── .gitignore ├── Classes ├── ASFSharedViewTransition.h └── ASFSharedViewTransition.m ├── Example ├── ASFTransitionTest.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── ASFTransitionTest.xccheckout │ │ └── xcuserdata │ │ │ └── asifmujteba.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── asifmujteba.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── ASFTransitionTest.xcscheme │ │ └── xcschememanagement.plist └── ASFTransitionTest │ ├── ASFTransitionTest-Info.plist │ ├── ASFTransitionTest-Prefix.pch │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ └── Main.storyboard │ ├── DetailViewController.h │ ├── DetailViewController.m │ ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json │ ├── ViewController.h │ ├── ViewController.m │ ├── en.lproj │ └── InfoPlist.strings │ ├── main.m │ ├── nature1.jpg │ ├── nature2.jpg │ ├── nature3.jpg │ ├── nature4.jpg │ ├── nature5.jpg │ ├── nature6.jpg │ ├── nature7.jpg │ └── nature8.jpg ├── LICENSE ├── README.md ├── iOSSharedViewTransition.podspec └── sample.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # CocoaPods 2 | # 3 | # We recommend against adding the Pods directory to your .gitignore. However 4 | # you should judge for yourself, the pros and cons are mentioned at: 5 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control? 6 | # 7 | # Pods/ 8 | 9 | -------------------------------------------------------------------------------- /Classes/ASFSharedViewTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASFSharedViewTransition.h 3 | // ASFTransitionTest 4 | // 5 | // Created by Asif Mujteba on 09/08/2014. 6 | // Copyright (c) 2014 Asif Mujteba. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ASFSharedViewTransitionDataSource 12 | 13 | - (UIView *)sharedView; 14 | 15 | @end 16 | 17 | @interface ASFSharedViewTransition : NSObject 18 | 19 | @property (nonatomic, weak) Class fromVCClass; 20 | @property (nonatomic, weak) Class toVCClass; 21 | 22 | + (void)addTransitionWithFromViewControllerClass:(Class)aFromVCClass 23 | ToViewControllerClass:(Class)aToVCClass 24 | WithNavigationController:(UINavigationController *)aNav 25 | WithDuration:(NSTimeInterval)aDuration; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Classes/ASFSharedViewTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASFSharedViewTransition.m 3 | // ASFTransitionTest 4 | // 5 | // Created by Asif Mujteba on 09/08/2014. 6 | // Copyright (c) 2014 Asif Mujteba. All rights reserved. 7 | // 8 | 9 | #import "ASFSharedViewTransition.h" 10 | #import 11 | 12 | @interface ParamsHolder : NSObject 13 | 14 | @property (nonatomic, weak) UINavigationController *nav; 15 | @property (nonatomic, weak) Class fromVCClass; 16 | @property (nonatomic, weak) Class toVCClass; 17 | 18 | @property (nonatomic, assign) NSTimeInterval duration; 19 | 20 | 21 | @end 22 | 23 | @implementation ParamsHolder 24 | 25 | @end 26 | 27 | @interface ASFSharedViewTransition () 28 | 29 | @property (nonatomic, retain) NSMutableArray *arrParamHolders; 30 | 31 | @end 32 | 33 | @implementation ASFSharedViewTransition 34 | 35 | #pragma mark - Setup & Initializers 36 | 37 | + (instancetype)shared 38 | { 39 | static ASFSharedViewTransition *instance = nil; 40 | static dispatch_once_t onceToken; 41 | dispatch_once(&onceToken, ^{ 42 | instance = [[ASFSharedViewTransition alloc] init]; 43 | }); 44 | return instance; 45 | } 46 | 47 | - (NSMutableArray *)arrParamHolders 48 | { 49 | if (!_arrParamHolders) { 50 | _arrParamHolders = [[NSMutableArray alloc] init]; 51 | } 52 | 53 | return _arrParamHolders; 54 | } 55 | 56 | #pragma mark - Private Methods 57 | 58 | - (ParamsHolder *)paramHolderForFromVC:(UIViewController *)fromVC ToVC:(UIViewController *)toVC reversed:(BOOL *)reversed { 59 | ParamsHolder *pHolder = nil; 60 | for (ParamsHolder *holder in [[ASFSharedViewTransition shared] arrParamHolders]) { 61 | if (holder.fromVCClass == [fromVC class] && holder.toVCClass == [toVC class]) { 62 | pHolder = holder; 63 | } 64 | else if (holder.fromVCClass == [toVC class] && holder.toVCClass == [fromVC class]) { 65 | pHolder = holder; 66 | 67 | if (reversed) { 68 | *reversed = true; 69 | } 70 | } 71 | } 72 | 73 | return pHolder; 74 | } 75 | 76 | #pragma mark - Public Methods 77 | 78 | + (void)addTransitionWithFromViewControllerClass:(Class)aFromVCClass 79 | ToViewControllerClass:(Class)aToVCClass 80 | WithNavigationController:(UINavigationController *)aNav 81 | WithDuration:(NSTimeInterval)aDuration 82 | { 83 | BOOL found = false; 84 | for (ParamsHolder *holder in [[ASFSharedViewTransition shared] arrParamHolders]) { 85 | if (holder.fromVCClass == aFromVCClass && holder.toVCClass == aToVCClass) { 86 | holder.duration = aDuration; 87 | holder.nav = aNav; 88 | holder.nav.delegate = [ASFSharedViewTransition shared]; 89 | 90 | found = true; 91 | break; 92 | } 93 | } 94 | 95 | if (!found) { 96 | ParamsHolder *holder = [[ParamsHolder alloc] init]; 97 | holder.fromVCClass = aFromVCClass; 98 | holder.toVCClass = aToVCClass; 99 | holder.duration = aDuration; 100 | holder.nav = aNav; 101 | 102 | holder.nav.delegate = [ASFSharedViewTransition shared]; 103 | [[[ASFSharedViewTransition shared] arrParamHolders] addObject:holder]; 104 | } 105 | } 106 | 107 | #pragma mark UINavigationControllerDelegate methods 108 | 109 | - (id)navigationController:(UINavigationController *)navigationController 110 | animationControllerForOperation:(UINavigationControllerOperation)operation 111 | fromViewController:(UIViewController *)fromVC 112 | toViewController:(UIViewController *)toVC { 113 | 114 | ParamsHolder *pHolder = [self paramHolderForFromVC:fromVC ToVC:toVC reversed:nil]; 115 | if (pHolder) { 116 | return [ASFSharedViewTransition shared]; 117 | } 118 | else { 119 | return nil; 120 | } 121 | } 122 | 123 | #pragma mark - UIViewControllerContextTransitioning 124 | 125 | - (void)animateTransition:(id)transitionContext 126 | { 127 | UIViewController *fromVC = 128 | (UIViewController *) [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 129 | UIViewController *toVC = 130 | (UIViewController *) [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 131 | 132 | BOOL reversed = false; 133 | ParamsHolder *pHolder = [self paramHolderForFromVC:fromVC ToVC:toVC reversed:&reversed]; 134 | 135 | if (!pHolder) { 136 | return; 137 | } 138 | 139 | UIView *fromView = [fromVC sharedView]; 140 | UIView *toView = [toVC sharedView]; 141 | 142 | UIView *containerView = [transitionContext containerView]; 143 | NSTimeInterval dur = [self transitionDuration:transitionContext]; 144 | 145 | // Take Snapshot of fomView 146 | UIView *snapshotView = [fromView snapshotViewAfterScreenUpdates:NO]; 147 | snapshotView.frame = [containerView convertRect:fromView.frame fromView:fromView.superview]; 148 | fromView.hidden = YES; 149 | 150 | // Setup the initial view states 151 | toVC.view.frame = [transitionContext finalFrameForViewController:toVC]; 152 | 153 | if (!reversed) { 154 | toVC.view.alpha = 0; 155 | toView.hidden = YES; 156 | [containerView addSubview:toVC.view]; 157 | } 158 | else { 159 | [containerView insertSubview:toVC.view belowSubview:fromVC.view]; 160 | } 161 | 162 | [containerView addSubview:snapshotView]; 163 | 164 | [UIView animateWithDuration:dur animations:^{ 165 | if (!reversed) { 166 | toVC.view.alpha = 1.0; // Fade in 167 | } 168 | else { 169 | fromVC.view.alpha = 0.0; // Fade out 170 | } 171 | 172 | // Move the SnapshotView 173 | snapshotView.frame = [containerView convertRect:toView.frame fromView:toView.superview]; 174 | 175 | } completion:^(BOOL finished) { 176 | // Clean up 177 | toView.hidden = NO; 178 | fromView.hidden = NO; 179 | [snapshotView removeFromSuperview]; 180 | 181 | // Declare that we've finished 182 | [transitionContext completeTransition:!transitionContext.transitionWasCancelled]; 183 | }]; 184 | } 185 | 186 | - (NSTimeInterval)transitionDuration:(id)transitionContext 187 | { 188 | UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 189 | UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 190 | 191 | ParamsHolder *pHolder = [self paramHolderForFromVC:fromVC ToVC:toVC reversed:nil]; 192 | 193 | if (pHolder) { 194 | return pHolder.duration; 195 | } 196 | else { 197 | return 0; 198 | } 199 | } 200 | 201 | @end 202 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F69DF7A3199DDCCC0054E296 /* ASFSharedViewTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = F69DF7A2199DDCCC0054E296 /* ASFSharedViewTransition.m */; }; 11 | F6AA6EF819954DDF00218E64 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6AA6EF719954DDF00218E64 /* Foundation.framework */; }; 12 | F6AA6EFA19954DDF00218E64 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6AA6EF919954DDF00218E64 /* CoreGraphics.framework */; }; 13 | F6AA6EFC19954DDF00218E64 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6AA6EFB19954DDF00218E64 /* UIKit.framework */; }; 14 | F6AA6F0219954DDF00218E64 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F6AA6F0019954DDF00218E64 /* InfoPlist.strings */; }; 15 | F6AA6F0419954DDF00218E64 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F6AA6F0319954DDF00218E64 /* main.m */; }; 16 | F6AA6F0819954DDF00218E64 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F6AA6F0719954DDF00218E64 /* AppDelegate.m */; }; 17 | F6AA6F0B19954DDF00218E64 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F6AA6F0919954DDF00218E64 /* Main.storyboard */; }; 18 | F6AA6F0E19954DDF00218E64 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F6AA6F0D19954DDF00218E64 /* ViewController.m */; }; 19 | F6AA6F1019954DDF00218E64 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F6AA6F0F19954DDF00218E64 /* Images.xcassets */; }; 20 | F6AA6F341995566C00218E64 /* nature1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = F6AA6F2C1995566C00218E64 /* nature1.jpg */; }; 21 | F6AA6F351995566C00218E64 /* nature2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = F6AA6F2D1995566C00218E64 /* nature2.jpg */; }; 22 | F6AA6F361995566C00218E64 /* nature3.jpg in Resources */ = {isa = PBXBuildFile; fileRef = F6AA6F2E1995566C00218E64 /* nature3.jpg */; }; 23 | F6AA6F371995566C00218E64 /* nature4.jpg in Resources */ = {isa = PBXBuildFile; fileRef = F6AA6F2F1995566C00218E64 /* nature4.jpg */; }; 24 | F6AA6F381995566C00218E64 /* nature5.jpg in Resources */ = {isa = PBXBuildFile; fileRef = F6AA6F301995566C00218E64 /* nature5.jpg */; }; 25 | F6AA6F391995566C00218E64 /* nature6.jpg in Resources */ = {isa = PBXBuildFile; fileRef = F6AA6F311995566C00218E64 /* nature6.jpg */; }; 26 | F6AA6F3A1995566C00218E64 /* nature7.jpg in Resources */ = {isa = PBXBuildFile; fileRef = F6AA6F321995566C00218E64 /* nature7.jpg */; }; 27 | F6AA6F3B1995566C00218E64 /* nature8.jpg in Resources */ = {isa = PBXBuildFile; fileRef = F6AA6F331995566C00218E64 /* nature8.jpg */; }; 28 | F6AA6F4119955FF300218E64 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F6AA6F4019955FF300218E64 /* DetailViewController.m */; }; 29 | /* End PBXBuildFile section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | F69DF7A1199DDCCC0054E296 /* ASFSharedViewTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASFSharedViewTransition.h; sourceTree = ""; }; 33 | F69DF7A2199DDCCC0054E296 /* ASFSharedViewTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASFSharedViewTransition.m; sourceTree = ""; }; 34 | F6AA6EF419954DDF00218E64 /* ASFTransitionTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ASFTransitionTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | F6AA6EF719954DDF00218E64 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 36 | F6AA6EF919954DDF00218E64 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 37 | F6AA6EFB19954DDF00218E64 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 38 | F6AA6EFF19954DDF00218E64 /* ASFTransitionTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ASFTransitionTest-Info.plist"; sourceTree = ""; }; 39 | F6AA6F0119954DDF00218E64 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 40 | F6AA6F0319954DDF00218E64 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 41 | F6AA6F0519954DDF00218E64 /* ASFTransitionTest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ASFTransitionTest-Prefix.pch"; sourceTree = ""; }; 42 | F6AA6F0619954DDF00218E64 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 43 | F6AA6F0719954DDF00218E64 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 44 | F6AA6F0A19954DDF00218E64 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | F6AA6F0C19954DDF00218E64 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 46 | F6AA6F0D19954DDF00218E64 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 47 | F6AA6F0F19954DDF00218E64 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 48 | F6AA6F1619954DDF00218E64 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 49 | F6AA6F1E19954DDF00218E64 /* ASFTransitionTestTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ASFTransitionTestTests-Info.plist"; sourceTree = ""; }; 50 | F6AA6F2019954DDF00218E64 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 51 | F6AA6F2219954DDF00218E64 /* ASFTransitionTestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASFTransitionTestTests.m; sourceTree = ""; }; 52 | F6AA6F2C1995566C00218E64 /* nature1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = nature1.jpg; sourceTree = ""; }; 53 | F6AA6F2D1995566C00218E64 /* nature2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = nature2.jpg; sourceTree = ""; }; 54 | F6AA6F2E1995566C00218E64 /* nature3.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = nature3.jpg; sourceTree = ""; }; 55 | F6AA6F2F1995566C00218E64 /* nature4.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = nature4.jpg; sourceTree = ""; }; 56 | F6AA6F301995566C00218E64 /* nature5.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = nature5.jpg; sourceTree = ""; }; 57 | F6AA6F311995566C00218E64 /* nature6.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = nature6.jpg; sourceTree = ""; }; 58 | F6AA6F321995566C00218E64 /* nature7.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = nature7.jpg; sourceTree = ""; }; 59 | F6AA6F331995566C00218E64 /* nature8.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = nature8.jpg; sourceTree = ""; }; 60 | F6AA6F3F19955FF300218E64 /* DetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; }; 61 | F6AA6F4019955FF300218E64 /* DetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; }; 62 | /* End PBXFileReference section */ 63 | 64 | /* Begin PBXFrameworksBuildPhase section */ 65 | F6AA6EF119954DDF00218E64 /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | F6AA6EFA19954DDF00218E64 /* CoreGraphics.framework in Frameworks */, 70 | F6AA6EFC19954DDF00218E64 /* UIKit.framework in Frameworks */, 71 | F6AA6EF819954DDF00218E64 /* Foundation.framework in Frameworks */, 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | /* End PBXFrameworksBuildPhase section */ 76 | 77 | /* Begin PBXGroup section */ 78 | F69DF7A0199DDCCC0054E296 /* Classes */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | F69DF7A1199DDCCC0054E296 /* ASFSharedViewTransition.h */, 82 | F69DF7A2199DDCCC0054E296 /* ASFSharedViewTransition.m */, 83 | ); 84 | name = Classes; 85 | path = ../../Classes; 86 | sourceTree = ""; 87 | }; 88 | F6AA6EEB19954DDF00218E64 = { 89 | isa = PBXGroup; 90 | children = ( 91 | F6AA6EFD19954DDF00218E64 /* ASFTransitionTest */, 92 | F6AA6F1C19954DDF00218E64 /* ASFTransitionTestTests */, 93 | F6AA6EF619954DDF00218E64 /* Frameworks */, 94 | F6AA6EF519954DDF00218E64 /* Products */, 95 | ); 96 | sourceTree = ""; 97 | }; 98 | F6AA6EF519954DDF00218E64 /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | F6AA6EF419954DDF00218E64 /* ASFTransitionTest.app */, 102 | ); 103 | name = Products; 104 | sourceTree = ""; 105 | }; 106 | F6AA6EF619954DDF00218E64 /* Frameworks */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | F6AA6EF719954DDF00218E64 /* Foundation.framework */, 110 | F6AA6EF919954DDF00218E64 /* CoreGraphics.framework */, 111 | F6AA6EFB19954DDF00218E64 /* UIKit.framework */, 112 | F6AA6F1619954DDF00218E64 /* XCTest.framework */, 113 | ); 114 | name = Frameworks; 115 | sourceTree = ""; 116 | }; 117 | F6AA6EFD19954DDF00218E64 /* ASFTransitionTest */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | F69DF7A0199DDCCC0054E296 /* Classes */, 121 | F6AA6F0619954DDF00218E64 /* AppDelegate.h */, 122 | F6AA6F0719954DDF00218E64 /* AppDelegate.m */, 123 | F6AA6F0919954DDF00218E64 /* Main.storyboard */, 124 | F6AA6F0C19954DDF00218E64 /* ViewController.h */, 125 | F6AA6F0D19954DDF00218E64 /* ViewController.m */, 126 | F6AA6F3F19955FF300218E64 /* DetailViewController.h */, 127 | F6AA6F4019955FF300218E64 /* DetailViewController.m */, 128 | F6AA6F0F19954DDF00218E64 /* Images.xcassets */, 129 | F6AA6EFE19954DDF00218E64 /* Supporting Files */, 130 | ); 131 | path = ASFTransitionTest; 132 | sourceTree = ""; 133 | }; 134 | F6AA6EFE19954DDF00218E64 /* Supporting Files */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | F6AA6F2C1995566C00218E64 /* nature1.jpg */, 138 | F6AA6F2D1995566C00218E64 /* nature2.jpg */, 139 | F6AA6F2E1995566C00218E64 /* nature3.jpg */, 140 | F6AA6F2F1995566C00218E64 /* nature4.jpg */, 141 | F6AA6F301995566C00218E64 /* nature5.jpg */, 142 | F6AA6F311995566C00218E64 /* nature6.jpg */, 143 | F6AA6F321995566C00218E64 /* nature7.jpg */, 144 | F6AA6F331995566C00218E64 /* nature8.jpg */, 145 | F6AA6EFF19954DDF00218E64 /* ASFTransitionTest-Info.plist */, 146 | F6AA6F0019954DDF00218E64 /* InfoPlist.strings */, 147 | F6AA6F0319954DDF00218E64 /* main.m */, 148 | F6AA6F0519954DDF00218E64 /* ASFTransitionTest-Prefix.pch */, 149 | ); 150 | name = "Supporting Files"; 151 | sourceTree = ""; 152 | }; 153 | F6AA6F1C19954DDF00218E64 /* ASFTransitionTestTests */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | F6AA6F2219954DDF00218E64 /* ASFTransitionTestTests.m */, 157 | F6AA6F1D19954DDF00218E64 /* Supporting Files */, 158 | ); 159 | path = ASFTransitionTestTests; 160 | sourceTree = ""; 161 | }; 162 | F6AA6F1D19954DDF00218E64 /* Supporting Files */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | F6AA6F1E19954DDF00218E64 /* ASFTransitionTestTests-Info.plist */, 166 | F6AA6F1F19954DDF00218E64 /* InfoPlist.strings */, 167 | ); 168 | name = "Supporting Files"; 169 | sourceTree = ""; 170 | }; 171 | /* End PBXGroup section */ 172 | 173 | /* Begin PBXNativeTarget section */ 174 | F6AA6EF319954DDF00218E64 /* ASFTransitionTest */ = { 175 | isa = PBXNativeTarget; 176 | buildConfigurationList = F6AA6F2619954DDF00218E64 /* Build configuration list for PBXNativeTarget "ASFTransitionTest" */; 177 | buildPhases = ( 178 | F6AA6EF019954DDF00218E64 /* Sources */, 179 | F6AA6EF119954DDF00218E64 /* Frameworks */, 180 | F6AA6EF219954DDF00218E64 /* Resources */, 181 | ); 182 | buildRules = ( 183 | ); 184 | dependencies = ( 185 | ); 186 | name = ASFTransitionTest; 187 | productName = ASFTransitionTest; 188 | productReference = F6AA6EF419954DDF00218E64 /* ASFTransitionTest.app */; 189 | productType = "com.apple.product-type.application"; 190 | }; 191 | /* End PBXNativeTarget section */ 192 | 193 | /* Begin PBXProject section */ 194 | F6AA6EEC19954DDF00218E64 /* Project object */ = { 195 | isa = PBXProject; 196 | attributes = { 197 | LastUpgradeCheck = 0500; 198 | ORGANIZATIONNAME = "Asif Mujteba"; 199 | }; 200 | buildConfigurationList = F6AA6EEF19954DDF00218E64 /* Build configuration list for PBXProject "ASFTransitionTest" */; 201 | compatibilityVersion = "Xcode 3.2"; 202 | developmentRegion = English; 203 | hasScannedForEncodings = 0; 204 | knownRegions = ( 205 | en, 206 | Base, 207 | ); 208 | mainGroup = F6AA6EEB19954DDF00218E64; 209 | productRefGroup = F6AA6EF519954DDF00218E64 /* Products */; 210 | projectDirPath = ""; 211 | projectRoot = ""; 212 | targets = ( 213 | F6AA6EF319954DDF00218E64 /* ASFTransitionTest */, 214 | ); 215 | }; 216 | /* End PBXProject section */ 217 | 218 | /* Begin PBXResourcesBuildPhase section */ 219 | F6AA6EF219954DDF00218E64 /* Resources */ = { 220 | isa = PBXResourcesBuildPhase; 221 | buildActionMask = 2147483647; 222 | files = ( 223 | F6AA6F1019954DDF00218E64 /* Images.xcassets in Resources */, 224 | F6AA6F3B1995566C00218E64 /* nature8.jpg in Resources */, 225 | F6AA6F351995566C00218E64 /* nature2.jpg in Resources */, 226 | F6AA6F0219954DDF00218E64 /* InfoPlist.strings in Resources */, 227 | F6AA6F371995566C00218E64 /* nature4.jpg in Resources */, 228 | F6AA6F391995566C00218E64 /* nature6.jpg in Resources */, 229 | F6AA6F341995566C00218E64 /* nature1.jpg in Resources */, 230 | F6AA6F3A1995566C00218E64 /* nature7.jpg in Resources */, 231 | F6AA6F361995566C00218E64 /* nature3.jpg in Resources */, 232 | F6AA6F381995566C00218E64 /* nature5.jpg in Resources */, 233 | F6AA6F0B19954DDF00218E64 /* Main.storyboard in Resources */, 234 | ); 235 | runOnlyForDeploymentPostprocessing = 0; 236 | }; 237 | /* End PBXResourcesBuildPhase section */ 238 | 239 | /* Begin PBXSourcesBuildPhase section */ 240 | F6AA6EF019954DDF00218E64 /* Sources */ = { 241 | isa = PBXSourcesBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | F6AA6F4119955FF300218E64 /* DetailViewController.m in Sources */, 245 | F69DF7A3199DDCCC0054E296 /* ASFSharedViewTransition.m in Sources */, 246 | F6AA6F0E19954DDF00218E64 /* ViewController.m in Sources */, 247 | F6AA6F0819954DDF00218E64 /* AppDelegate.m in Sources */, 248 | F6AA6F0419954DDF00218E64 /* main.m in Sources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | /* End PBXSourcesBuildPhase section */ 253 | 254 | /* Begin PBXVariantGroup section */ 255 | F6AA6F0019954DDF00218E64 /* InfoPlist.strings */ = { 256 | isa = PBXVariantGroup; 257 | children = ( 258 | F6AA6F0119954DDF00218E64 /* en */, 259 | ); 260 | name = InfoPlist.strings; 261 | sourceTree = ""; 262 | }; 263 | F6AA6F0919954DDF00218E64 /* Main.storyboard */ = { 264 | isa = PBXVariantGroup; 265 | children = ( 266 | F6AA6F0A19954DDF00218E64 /* Base */, 267 | ); 268 | name = Main.storyboard; 269 | sourceTree = ""; 270 | }; 271 | F6AA6F1F19954DDF00218E64 /* InfoPlist.strings */ = { 272 | isa = PBXVariantGroup; 273 | children = ( 274 | F6AA6F2019954DDF00218E64 /* en */, 275 | ); 276 | name = InfoPlist.strings; 277 | sourceTree = ""; 278 | }; 279 | /* End PBXVariantGroup section */ 280 | 281 | /* Begin XCBuildConfiguration section */ 282 | F6AA6F2419954DDF00218E64 /* Debug */ = { 283 | isa = XCBuildConfiguration; 284 | buildSettings = { 285 | ALWAYS_SEARCH_USER_PATHS = NO; 286 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 287 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 288 | CLANG_CXX_LIBRARY = "libc++"; 289 | CLANG_ENABLE_MODULES = YES; 290 | CLANG_ENABLE_OBJC_ARC = YES; 291 | CLANG_WARN_BOOL_CONVERSION = YES; 292 | CLANG_WARN_CONSTANT_CONVERSION = YES; 293 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 294 | CLANG_WARN_EMPTY_BODY = YES; 295 | CLANG_WARN_ENUM_CONVERSION = YES; 296 | CLANG_WARN_INT_CONVERSION = YES; 297 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 298 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 299 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 300 | COPY_PHASE_STRIP = NO; 301 | GCC_C_LANGUAGE_STANDARD = gnu99; 302 | GCC_DYNAMIC_NO_PIC = NO; 303 | GCC_OPTIMIZATION_LEVEL = 0; 304 | GCC_PREPROCESSOR_DEFINITIONS = ( 305 | "DEBUG=1", 306 | "$(inherited)", 307 | ); 308 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 309 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 310 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 311 | GCC_WARN_UNDECLARED_SELECTOR = YES; 312 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 313 | GCC_WARN_UNUSED_FUNCTION = YES; 314 | GCC_WARN_UNUSED_VARIABLE = YES; 315 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 316 | ONLY_ACTIVE_ARCH = YES; 317 | SDKROOT = iphoneos; 318 | }; 319 | name = Debug; 320 | }; 321 | F6AA6F2519954DDF00218E64 /* Release */ = { 322 | isa = XCBuildConfiguration; 323 | buildSettings = { 324 | ALWAYS_SEARCH_USER_PATHS = NO; 325 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 326 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 327 | CLANG_CXX_LIBRARY = "libc++"; 328 | CLANG_ENABLE_MODULES = YES; 329 | CLANG_ENABLE_OBJC_ARC = YES; 330 | CLANG_WARN_BOOL_CONVERSION = YES; 331 | CLANG_WARN_CONSTANT_CONVERSION = YES; 332 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 333 | CLANG_WARN_EMPTY_BODY = YES; 334 | CLANG_WARN_ENUM_CONVERSION = YES; 335 | CLANG_WARN_INT_CONVERSION = YES; 336 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 339 | COPY_PHASE_STRIP = YES; 340 | ENABLE_NS_ASSERTIONS = NO; 341 | GCC_C_LANGUAGE_STANDARD = gnu99; 342 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 343 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 344 | GCC_WARN_UNDECLARED_SELECTOR = YES; 345 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 346 | GCC_WARN_UNUSED_FUNCTION = YES; 347 | GCC_WARN_UNUSED_VARIABLE = YES; 348 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 349 | SDKROOT = iphoneos; 350 | VALIDATE_PRODUCT = YES; 351 | }; 352 | name = Release; 353 | }; 354 | F6AA6F2719954DDF00218E64 /* Debug */ = { 355 | isa = XCBuildConfiguration; 356 | buildSettings = { 357 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 358 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 359 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 360 | GCC_PREFIX_HEADER = "ASFTransitionTest/ASFTransitionTest-Prefix.pch"; 361 | INFOPLIST_FILE = "ASFTransitionTest/ASFTransitionTest-Info.plist"; 362 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 363 | PRODUCT_NAME = "$(TARGET_NAME)"; 364 | WRAPPER_EXTENSION = app; 365 | }; 366 | name = Debug; 367 | }; 368 | F6AA6F2819954DDF00218E64 /* Release */ = { 369 | isa = XCBuildConfiguration; 370 | buildSettings = { 371 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 372 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 373 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 374 | GCC_PREFIX_HEADER = "ASFTransitionTest/ASFTransitionTest-Prefix.pch"; 375 | INFOPLIST_FILE = "ASFTransitionTest/ASFTransitionTest-Info.plist"; 376 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 377 | PRODUCT_NAME = "$(TARGET_NAME)"; 378 | WRAPPER_EXTENSION = app; 379 | }; 380 | name = Release; 381 | }; 382 | /* End XCBuildConfiguration section */ 383 | 384 | /* Begin XCConfigurationList section */ 385 | F6AA6EEF19954DDF00218E64 /* Build configuration list for PBXProject "ASFTransitionTest" */ = { 386 | isa = XCConfigurationList; 387 | buildConfigurations = ( 388 | F6AA6F2419954DDF00218E64 /* Debug */, 389 | F6AA6F2519954DDF00218E64 /* Release */, 390 | ); 391 | defaultConfigurationIsVisible = 0; 392 | defaultConfigurationName = Release; 393 | }; 394 | F6AA6F2619954DDF00218E64 /* Build configuration list for PBXNativeTarget "ASFTransitionTest" */ = { 395 | isa = XCConfigurationList; 396 | buildConfigurations = ( 397 | F6AA6F2719954DDF00218E64 /* Debug */, 398 | F6AA6F2819954DDF00218E64 /* Release */, 399 | ); 400 | defaultConfigurationIsVisible = 0; 401 | defaultConfigurationName = Release; 402 | }; 403 | /* End XCConfigurationList section */ 404 | }; 405 | rootObject = F6AA6EEC19954DDF00218E64 /* Project object */; 406 | } 407 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest.xcodeproj/project.xcworkspace/xcshareddata/ASFTransitionTest.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 8D05D9E3-6EBE-4035-B7ED-1F9B8E9CE185 9 | IDESourceControlProjectName 10 | ASFTransitionTest 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 1C9C2C36-F632-4829-9915-1664F7C35606 14 | https://github.com/asifmujteba/iOSSharedViewTransition.git 15 | 16 | IDESourceControlProjectPath 17 | ASFTransitionTest.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 1C9C2C36-F632-4829-9915-1664F7C35606 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/asifmujteba/iOSSharedViewTransition.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | 1C9C2C36-F632-4829-9915-1664F7C35606 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 1C9C2C36-F632-4829-9915-1664F7C35606 36 | IDESourceControlWCCName 37 | iOSSharedViewTransition 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest.xcodeproj/project.xcworkspace/xcuserdata/asifmujteba.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifmujteba/iOSSharedViewTransition/2954e194001005f14fa18e4260187734850e5baf/Example/ASFTransitionTest.xcodeproj/project.xcworkspace/xcuserdata/asifmujteba.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/ASFTransitionTest.xcodeproj/xcuserdata/asifmujteba.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest.xcodeproj/xcuserdata/asifmujteba.xcuserdatad/xcschemes/ASFTransitionTest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest.xcodeproj/xcuserdata/asifmujteba.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ASFTransitionTest.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F6AA6EF319954DDF00218E64 16 | 17 | primary 18 | 19 | 20 | F6AA6F1419954DDF00218E64 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest/ASFTransitionTest-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | AM.${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 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest/ASFTransitionTest-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 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ASFTransitionTest 4 | // 5 | // Created by Asif Mujteba on 08/08/2014. 6 | // Copyright (c) 2014 Asif Mujteba. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ASFTransitionTest 4 | // 5 | // Created by Asif Mujteba on 08/08/2014. 6 | // Copyright (c) 2014 Asif Mujteba. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | #import "DetailViewController.h" 12 | #import "ASFSharedViewTransition.h" 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | // Override point for customization after application launch. 19 | 20 | // Add Transition 21 | [ASFSharedViewTransition addTransitionWithFromViewControllerClass:[ViewController class] 22 | ToViewControllerClass:[DetailViewController class] 23 | WithNavigationController:(UINavigationController *)self.window.rootViewController 24 | WithDuration:0.3f]; 25 | 26 | return YES; 27 | } 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application 30 | { 31 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 32 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 33 | } 34 | 35 | - (void)applicationDidEnterBackground:(UIApplication *)application 36 | { 37 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 38 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 39 | } 40 | 41 | - (void)applicationWillEnterForeground:(UIApplication *)application 42 | { 43 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 44 | } 45 | 46 | - (void)applicationDidBecomeActive:(UIApplication *)application 47 | { 48 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 49 | } 50 | 51 | - (void)applicationWillTerminate:(UIApplication *)application 52 | { 53 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest/Base.lproj/Main.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 | 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 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 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. 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest/DetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.h 3 | // ASFTransitionTest 4 | // 5 | // Created by Asif Mujteba on 09/08/2014. 6 | // Copyright (c) 2014 Asif Mujteba. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DetailViewController : UIViewController 12 | 13 | @property (weak, nonatomic) IBOutlet UIImageView *imageView; 14 | 15 | @property (nonatomic, retain) UIImage *image; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest/DetailViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.m 3 | // ASFTransitionTest 4 | // 5 | // Created by Asif Mujteba on 09/08/2014. 6 | // Copyright (c) 2014 Asif Mujteba. All rights reserved. 7 | // 8 | 9 | #import "DetailViewController.h" 10 | #import "ASFSharedViewTransition.h" 11 | 12 | @interface DetailViewController () 13 | 14 | @end 15 | 16 | @implementation DetailViewController 17 | 18 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 19 | { 20 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 21 | if (self) { 22 | // Custom initialization 23 | } 24 | return self; 25 | } 26 | 27 | - (void)viewDidLoad 28 | { 29 | [super viewDidLoad]; 30 | // Do any additional setup after loading the view. 31 | 32 | _imageView.image = _image; 33 | } 34 | 35 | - (void)didReceiveMemoryWarning 36 | { 37 | [super didReceiveMemoryWarning]; 38 | // Dispose of any resources that can be recreated. 39 | } 40 | 41 | #pragma mark - ASFSharedViewTransitionDataSource 42 | 43 | - (UIView *)sharedView 44 | { 45 | return _imageView; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest/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 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/ASFTransitionTest/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 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/ASFTransitionTest/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ASFTransitionTest 4 | // 5 | // Created by Asif Mujteba on 08/08/2014. 6 | // Copyright (c) 2014 Asif Mujteba. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @property (weak, nonatomic) IBOutlet UICollectionView *collectionView; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ASFTransitionTest 4 | // 5 | // Created by Asif Mujteba on 08/08/2014. 6 | // Copyright (c) 2014 Asif Mujteba. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "DetailViewController.h" 11 | #import "ASFSharedViewTransition.h" 12 | 13 | @interface ViewController () 14 | 15 | @property (nonatomic, retain) NSMutableArray *arrImages; 16 | 17 | @end 18 | 19 | @implementation ViewController 20 | 21 | - (void)viewDidLoad 22 | { 23 | [super viewDidLoad]; 24 | 25 | _arrImages = [[NSMutableArray alloc] init]; 26 | for (int i=1; i<=8; i++) { 27 | [_arrImages addObject:[UIImage imageNamed:[NSString stringWithFormat:@"nature%d.jpg", i]]]; 28 | } 29 | 30 | for (int i=1; i<=8; i++) { 31 | [_arrImages addObject:[UIImage imageNamed:[NSString stringWithFormat:@"nature%d.jpg", i]]]; 32 | } 33 | } 34 | 35 | - (void)didReceiveMemoryWarning 36 | { 37 | [super didReceiveMemoryWarning]; 38 | // Dispose of any resources that can be recreated. 39 | } 40 | 41 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 42 | if ([segue.destinationViewController isKindOfClass:[DetailViewController class]]) { 43 | // Get the selected item index path 44 | NSIndexPath *selectedIndexPath = [[_collectionView indexPathsForSelectedItems] firstObject]; 45 | 46 | // Set the thing on the view controller we're about to show 47 | if (selectedIndexPath != nil) { 48 | DetailViewController *detailVC = segue.destinationViewController; 49 | detailVC.image = self.arrImages[selectedIndexPath.row]; 50 | } 51 | } 52 | } 53 | 54 | #pragma mark UICollectionViewControllerDataSource methods 55 | 56 | - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView 57 | { 58 | return 1; 59 | } 60 | 61 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section 62 | { 63 | return [self.arrImages count]; 64 | } 65 | 66 | - (UICollectionViewCell*)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 67 | { 68 | UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" 69 | forIndexPath:indexPath]; 70 | 71 | UIImage *img = self.arrImages[indexPath.row]; 72 | 73 | cell.layer.contents = (id)img.CGImage; 74 | 75 | return cell; 76 | } 77 | 78 | #pragma mark - ASFSharedViewTransitionDataSource 79 | 80 | - (UIView *)sharedView 81 | { 82 | return [_collectionView cellForItemAtIndexPath:[[_collectionView indexPathsForSelectedItems] firstObject]]; 83 | } 84 | 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ASFTransitionTest 4 | // 5 | // Created by Asif Mujteba on 08/08/2014. 6 | // Copyright (c) 2014 Asif Mujteba. 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 | -------------------------------------------------------------------------------- /Example/ASFTransitionTest/nature1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifmujteba/iOSSharedViewTransition/2954e194001005f14fa18e4260187734850e5baf/Example/ASFTransitionTest/nature1.jpg -------------------------------------------------------------------------------- /Example/ASFTransitionTest/nature2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifmujteba/iOSSharedViewTransition/2954e194001005f14fa18e4260187734850e5baf/Example/ASFTransitionTest/nature2.jpg -------------------------------------------------------------------------------- /Example/ASFTransitionTest/nature3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifmujteba/iOSSharedViewTransition/2954e194001005f14fa18e4260187734850e5baf/Example/ASFTransitionTest/nature3.jpg -------------------------------------------------------------------------------- /Example/ASFTransitionTest/nature4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifmujteba/iOSSharedViewTransition/2954e194001005f14fa18e4260187734850e5baf/Example/ASFTransitionTest/nature4.jpg -------------------------------------------------------------------------------- /Example/ASFTransitionTest/nature5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifmujteba/iOSSharedViewTransition/2954e194001005f14fa18e4260187734850e5baf/Example/ASFTransitionTest/nature5.jpg -------------------------------------------------------------------------------- /Example/ASFTransitionTest/nature6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifmujteba/iOSSharedViewTransition/2954e194001005f14fa18e4260187734850e5baf/Example/ASFTransitionTest/nature6.jpg -------------------------------------------------------------------------------- /Example/ASFTransitionTest/nature7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifmujteba/iOSSharedViewTransition/2954e194001005f14fa18e4260187734850e5baf/Example/ASFTransitionTest/nature7.jpg -------------------------------------------------------------------------------- /Example/ASFTransitionTest/nature8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifmujteba/iOSSharedViewTransition/2954e194001005f14fa18e4260187734850e5baf/Example/ASFTransitionTest/nature8.jpg -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Asif Mujteba 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | iOSSharedViewTransition 2 | ======================= 3 | 4 | iOS 7 based transition library for View Controllers having a Common View 5 | 6 | - Inspired by Shared View Activity Transitions introduced in Android L. 7 | 8 | ![iOSSharedViewTransition](https://raw.githubusercontent.com/asifmujteba/iOSSharedViewTransition/master/sample.gif) 9 | 10 |

USAGE

11 | Very Simple 3 Step Process: 12 | 13 | - Download and include `ASFSharedViewTransition.h` and `ASFSharedViewTransition.m` in your Project. 14 | - In your app delegate or somewhere else in code do `#import "ASFSharedViewTransition.h"` and add tansitions like this: 15 | ```` 16 | [ASFSharedViewTransition addTransitionWithFromViewControllerClass:[ViewController class] 17 | ToViewControllerClass:[DetailViewController class] 18 | WithNavigationController:(UINavigationController *)self.window.rootViewController 19 | WithDuration:0.3f]; 20 | ```` 21 | 22 | **Note:** Transition needs to be added only one time and ASFSharedViewTransition will automatically apply transitions whenever specified UINavigationController navigates between any FromViewController and ToViewController instances. 23 | 24 | - Confirm From & To View Controllers to `ASFSharedViewTransitionDataSource` and provide the Common View by implementing this method: 25 | ```` 26 | - (UIView *)sharedView 27 | ```` 28 | 29 | Thats it! A Sample Demo Application has been included for help. 30 | 31 |

Installation

32 | iOSSharedViewTransition is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile: 33 | 34 | pod 'iOSSharedViewTransition', '~> 1.0.2' 35 | 36 |

Coming Soon

37 | - Adding more transitions to the library 38 | - If you would like to request a new feature, feel free to raise as an issue. 39 | 40 |

Author

41 | Asif Mujteba, asifmujteba@gmail.com 42 | 43 |

License

44 | ASFSharedViewTransition is available under the MIT license. See the LICENSE file for more info. 45 | 46 | -------------------------------------------------------------------------------- /iOSSharedViewTransition.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "iOSSharedViewTransition" 4 | s.version = "1.0.2" 5 | s.summary = "iOS 7 based transition library for View Controllers having a Common View" 6 | 7 | s.description = <<-DESC 8 | An iOS 7 based transition library for View Controllers having a Common View. 9 | DESC 10 | 11 | s.homepage = "https://github.com/asifmujteba/iOSSharedViewTransition" 12 | s.screenshots = "https://raw.githubusercontent.com/asifmujteba/iOSSharedViewTransition/master/sample.gif" 13 | 14 | s.license = { :type => "MIT", :file => "LICENSE" } 15 | 16 | s.author = { "Asif Mujteba" => "asifmujteba@gmail.com" } 17 | 18 | s.platform = :ios, "7.0" 19 | 20 | s.source = { :git => "https://github.com/asifmujteba/iOSSharedViewTransition.git", :tag => "1.0.2" } 21 | 22 | s.source_files = "Classes", "*.{h,m}" 23 | 24 | s.public_header_files = "Classes/*.h" 25 | 26 | s.requires_arc = true 27 | 28 | end 29 | -------------------------------------------------------------------------------- /sample.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifmujteba/iOSSharedViewTransition/2954e194001005f14fa18e4260187734850e5baf/sample.gif --------------------------------------------------------------------------------