├── .gitignore ├── Demo ├── MHNatGeoViewControllerTransitionDemo.xcodeproj │ └── project.pbxproj ├── MHNatGeoViewControllerTransitionDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── DemoWithPresentAndDismissViewController.h │ ├── DemoWithPresentAndDismissViewController.m │ ├── MHNatGeoViewControllerTransitionDemo-Info.plist │ ├── MHNatGeoViewControllerTransitionDemo-Prefix.pch │ ├── destination.png │ ├── destination@2x.png │ ├── en.lproj │ │ ├── InfoPlist.strings │ │ └── MainStoryboard.storyboard │ ├── final.png │ ├── final@2x.png │ ├── main.m │ ├── source.png │ └── source@2x.png └── MHNatGeoViewControllerTransitionDemoTests │ ├── MHNatGeoViewControllerTransitionDemoTests-Info.plist │ ├── MHNatGeoViewControllerTransitionDemoTests.h │ ├── MHNatGeoViewControllerTransitionDemoTests.m │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE.md ├── MHNatGeoViewControllerTransition.podspec ├── MHNatGeoViewControllerTransition ├── MHNatGeoSegue.h ├── MHNatGeoSegue.m ├── MHNatGeoViewControllerTransition.h └── MHNatGeoViewControllerTransition.m └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 993FDE33176436AF00CF623A /* destination.png in Resources */ = {isa = PBXBuildFile; fileRef = 993FDE2F176436AF00CF623A /* destination.png */; }; 11 | 993FDE34176436B000CF623A /* final.png in Resources */ = {isa = PBXBuildFile; fileRef = 993FDE30176436AF00CF623A /* final.png */; }; 12 | 993FDE35176436B000CF623A /* final@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 993FDE31176436AF00CF623A /* final@2x.png */; }; 13 | 993FDE36176436B000CF623A /* source.png in Resources */ = {isa = PBXBuildFile; fileRef = 993FDE32176436AF00CF623A /* source.png */; }; 14 | 993FDE39176436CA00CF623A /* destination@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 993FDE37176436CA00CF623A /* destination@2x.png */; }; 15 | 993FDE3A176436CA00CF623A /* source@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 993FDE38176436CA00CF623A /* source@2x.png */; }; 16 | 99543E001761B6740077A72B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99543DFF1761B6740077A72B /* UIKit.framework */; }; 17 | 99543E021761B6740077A72B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99543E011761B6740077A72B /* Foundation.framework */; }; 18 | 99543E041761B6740077A72B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99543E031761B6740077A72B /* CoreGraphics.framework */; }; 19 | 99543E0A1761B6740077A72B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 99543E081761B6740077A72B /* InfoPlist.strings */; }; 20 | 99543E0C1761B6740077A72B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 99543E0B1761B6740077A72B /* main.m */; }; 21 | 99543E101761B6740077A72B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 99543E0F1761B6740077A72B /* AppDelegate.m */; }; 22 | 99543E121761B6750077A72B /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 99543E111761B6750077A72B /* Default.png */; }; 23 | 99543E141761B6750077A72B /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 99543E131761B6750077A72B /* Default@2x.png */; }; 24 | 99543E161761B6750077A72B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 99543E151761B6750077A72B /* Default-568h@2x.png */; }; 25 | 99543E191761B6750077A72B /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 99543E171761B6750077A72B /* MainStoryboard.storyboard */; }; 26 | 99543E241761B6760077A72B /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99543E231761B6760077A72B /* SenTestingKit.framework */; }; 27 | 99543E251761B6760077A72B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99543DFF1761B6740077A72B /* UIKit.framework */; }; 28 | 99543E261761B6760077A72B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99543E011761B6740077A72B /* Foundation.framework */; }; 29 | 99543E2E1761B6760077A72B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 99543E2C1761B6760077A72B /* InfoPlist.strings */; }; 30 | 99543E311761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 99543E301761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests.m */; }; 31 | 99543E3F1761B6E50077A72B /* MHNatGeoSegue.m in Sources */ = {isa = PBXBuildFile; fileRef = 99543E3C1761B6E50077A72B /* MHNatGeoSegue.m */; }; 32 | 99543E401761B6E50077A72B /* MHNatGeoViewControllerTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 99543E3E1761B6E50077A72B /* MHNatGeoViewControllerTransition.m */; }; 33 | 99543E421761B7000077A72B /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99543E411761B7000077A72B /* QuartzCore.framework */; }; 34 | 99543E521761C93E0077A72B /* DemoWithPresentAndDismissViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 99543E511761C93E0077A72B /* DemoWithPresentAndDismissViewController.m */; }; 35 | /* End PBXBuildFile section */ 36 | 37 | /* Begin PBXContainerItemProxy section */ 38 | 99543E271761B6760077A72B /* PBXContainerItemProxy */ = { 39 | isa = PBXContainerItemProxy; 40 | containerPortal = 99543DF41761B6740077A72B /* Project object */; 41 | proxyType = 1; 42 | remoteGlobalIDString = 99543DFB1761B6740077A72B; 43 | remoteInfo = MHNatGeoViewControllerTransitionDemo; 44 | }; 45 | /* End PBXContainerItemProxy section */ 46 | 47 | /* Begin PBXFileReference section */ 48 | 993FDE2F176436AF00CF623A /* destination.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = destination.png; sourceTree = ""; }; 49 | 993FDE30176436AF00CF623A /* final.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = final.png; sourceTree = ""; }; 50 | 993FDE31176436AF00CF623A /* final@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "final@2x.png"; sourceTree = ""; }; 51 | 993FDE32176436AF00CF623A /* source.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = source.png; sourceTree = ""; }; 52 | 993FDE37176436CA00CF623A /* destination@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "destination@2x.png"; sourceTree = ""; }; 53 | 993FDE38176436CA00CF623A /* source@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "source@2x.png"; sourceTree = ""; }; 54 | 99543DFC1761B6740077A72B /* MHNatGeoViewControllerTransitionDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MHNatGeoViewControllerTransitionDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 99543DFF1761B6740077A72B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 56 | 99543E011761B6740077A72B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 57 | 99543E031761B6740077A72B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 58 | 99543E071761B6740077A72B /* MHNatGeoViewControllerTransitionDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MHNatGeoViewControllerTransitionDemo-Info.plist"; sourceTree = ""; }; 59 | 99543E091761B6740077A72B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 60 | 99543E0B1761B6740077A72B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 61 | 99543E0D1761B6740077A72B /* MHNatGeoViewControllerTransitionDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MHNatGeoViewControllerTransitionDemo-Prefix.pch"; sourceTree = ""; }; 62 | 99543E0E1761B6740077A72B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 63 | 99543E0F1761B6740077A72B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 64 | 99543E111761B6750077A72B /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 65 | 99543E131761B6750077A72B /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 66 | 99543E151761B6750077A72B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 67 | 99543E181761B6750077A72B /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = ""; }; 68 | 99543E221761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MHNatGeoViewControllerTransitionDemoTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 69 | 99543E231761B6760077A72B /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; 70 | 99543E2B1761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MHNatGeoViewControllerTransitionDemoTests-Info.plist"; sourceTree = ""; }; 71 | 99543E2D1761B6760077A72B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 72 | 99543E2F1761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MHNatGeoViewControllerTransitionDemoTests.h; sourceTree = ""; }; 73 | 99543E301761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MHNatGeoViewControllerTransitionDemoTests.m; sourceTree = ""; }; 74 | 99543E3B1761B6E50077A72B /* MHNatGeoSegue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MHNatGeoSegue.h; sourceTree = ""; }; 75 | 99543E3C1761B6E50077A72B /* MHNatGeoSegue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MHNatGeoSegue.m; sourceTree = ""; }; 76 | 99543E3D1761B6E50077A72B /* MHNatGeoViewControllerTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MHNatGeoViewControllerTransition.h; sourceTree = ""; }; 77 | 99543E3E1761B6E50077A72B /* MHNatGeoViewControllerTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MHNatGeoViewControllerTransition.m; sourceTree = ""; }; 78 | 99543E411761B7000077A72B /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 79 | 99543E501761C93E0077A72B /* DemoWithPresentAndDismissViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoWithPresentAndDismissViewController.h; sourceTree = ""; }; 80 | 99543E511761C93E0077A72B /* DemoWithPresentAndDismissViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoWithPresentAndDismissViewController.m; sourceTree = ""; }; 81 | /* End PBXFileReference section */ 82 | 83 | /* Begin PBXFrameworksBuildPhase section */ 84 | 99543DF91761B6740077A72B /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | 99543E421761B7000077A72B /* QuartzCore.framework in Frameworks */, 89 | 99543E001761B6740077A72B /* UIKit.framework in Frameworks */, 90 | 99543E021761B6740077A72B /* Foundation.framework in Frameworks */, 91 | 99543E041761B6740077A72B /* CoreGraphics.framework in Frameworks */, 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | 99543E1E1761B6760077A72B /* Frameworks */ = { 96 | isa = PBXFrameworksBuildPhase; 97 | buildActionMask = 2147483647; 98 | files = ( 99 | 99543E241761B6760077A72B /* SenTestingKit.framework in Frameworks */, 100 | 99543E251761B6760077A72B /* UIKit.framework in Frameworks */, 101 | 99543E261761B6760077A72B /* Foundation.framework in Frameworks */, 102 | ); 103 | runOnlyForDeploymentPostprocessing = 0; 104 | }; 105 | /* End PBXFrameworksBuildPhase section */ 106 | 107 | /* Begin PBXGroup section */ 108 | 99543DF31761B6740077A72B = { 109 | isa = PBXGroup; 110 | children = ( 111 | 99543E3A1761B6E50077A72B /* MHNatGeoViewControllerTransition */, 112 | 99543E051761B6740077A72B /* MHNatGeoViewControllerTransitionDemo */, 113 | 99543E291761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests */, 114 | 99543DFE1761B6740077A72B /* Frameworks */, 115 | 99543DFD1761B6740077A72B /* Products */, 116 | ); 117 | sourceTree = ""; 118 | }; 119 | 99543DFD1761B6740077A72B /* Products */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 99543DFC1761B6740077A72B /* MHNatGeoViewControllerTransitionDemo.app */, 123 | 99543E221761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests.octest */, 124 | ); 125 | name = Products; 126 | sourceTree = ""; 127 | }; 128 | 99543DFE1761B6740077A72B /* Frameworks */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 99543E411761B7000077A72B /* QuartzCore.framework */, 132 | 99543DFF1761B6740077A72B /* UIKit.framework */, 133 | 99543E011761B6740077A72B /* Foundation.framework */, 134 | 99543E031761B6740077A72B /* CoreGraphics.framework */, 135 | 99543E231761B6760077A72B /* SenTestingKit.framework */, 136 | ); 137 | name = Frameworks; 138 | sourceTree = ""; 139 | }; 140 | 99543E051761B6740077A72B /* MHNatGeoViewControllerTransitionDemo */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 99543E0E1761B6740077A72B /* AppDelegate.h */, 144 | 99543E0F1761B6740077A72B /* AppDelegate.m */, 145 | 99543E171761B6750077A72B /* MainStoryboard.storyboard */, 146 | 99543E061761B6740077A72B /* Supporting Files */, 147 | 99543E501761C93E0077A72B /* DemoWithPresentAndDismissViewController.h */, 148 | 99543E511761C93E0077A72B /* DemoWithPresentAndDismissViewController.m */, 149 | ); 150 | path = MHNatGeoViewControllerTransitionDemo; 151 | sourceTree = ""; 152 | }; 153 | 99543E061761B6740077A72B /* Supporting Files */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | 993FDE37176436CA00CF623A /* destination@2x.png */, 157 | 993FDE38176436CA00CF623A /* source@2x.png */, 158 | 993FDE2F176436AF00CF623A /* destination.png */, 159 | 993FDE30176436AF00CF623A /* final.png */, 160 | 993FDE31176436AF00CF623A /* final@2x.png */, 161 | 993FDE32176436AF00CF623A /* source.png */, 162 | 99543E071761B6740077A72B /* MHNatGeoViewControllerTransitionDemo-Info.plist */, 163 | 99543E081761B6740077A72B /* InfoPlist.strings */, 164 | 99543E0B1761B6740077A72B /* main.m */, 165 | 99543E0D1761B6740077A72B /* MHNatGeoViewControllerTransitionDemo-Prefix.pch */, 166 | 99543E111761B6750077A72B /* Default.png */, 167 | 99543E131761B6750077A72B /* Default@2x.png */, 168 | 99543E151761B6750077A72B /* Default-568h@2x.png */, 169 | ); 170 | name = "Supporting Files"; 171 | sourceTree = ""; 172 | }; 173 | 99543E291761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | 99543E2F1761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests.h */, 177 | 99543E301761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests.m */, 178 | 99543E2A1761B6760077A72B /* Supporting Files */, 179 | ); 180 | path = MHNatGeoViewControllerTransitionDemoTests; 181 | sourceTree = ""; 182 | }; 183 | 99543E2A1761B6760077A72B /* Supporting Files */ = { 184 | isa = PBXGroup; 185 | children = ( 186 | 99543E2B1761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests-Info.plist */, 187 | 99543E2C1761B6760077A72B /* InfoPlist.strings */, 188 | ); 189 | name = "Supporting Files"; 190 | sourceTree = ""; 191 | }; 192 | 99543E3A1761B6E50077A72B /* MHNatGeoViewControllerTransition */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | 99543E3B1761B6E50077A72B /* MHNatGeoSegue.h */, 196 | 99543E3C1761B6E50077A72B /* MHNatGeoSegue.m */, 197 | 99543E3D1761B6E50077A72B /* MHNatGeoViewControllerTransition.h */, 198 | 99543E3E1761B6E50077A72B /* MHNatGeoViewControllerTransition.m */, 199 | ); 200 | name = MHNatGeoViewControllerTransition; 201 | path = ../MHNatGeoViewControllerTransition; 202 | sourceTree = ""; 203 | }; 204 | /* End PBXGroup section */ 205 | 206 | /* Begin PBXNativeTarget section */ 207 | 99543DFB1761B6740077A72B /* MHNatGeoViewControllerTransitionDemo */ = { 208 | isa = PBXNativeTarget; 209 | buildConfigurationList = 99543E341761B6760077A72B /* Build configuration list for PBXNativeTarget "MHNatGeoViewControllerTransitionDemo" */; 210 | buildPhases = ( 211 | 99543DF81761B6740077A72B /* Sources */, 212 | 99543DF91761B6740077A72B /* Frameworks */, 213 | 99543DFA1761B6740077A72B /* Resources */, 214 | ); 215 | buildRules = ( 216 | ); 217 | dependencies = ( 218 | ); 219 | name = MHNatGeoViewControllerTransitionDemo; 220 | productName = MHNatGeoViewControllerTransitionDemo; 221 | productReference = 99543DFC1761B6740077A72B /* MHNatGeoViewControllerTransitionDemo.app */; 222 | productType = "com.apple.product-type.application"; 223 | }; 224 | 99543E211761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests */ = { 225 | isa = PBXNativeTarget; 226 | buildConfigurationList = 99543E371761B6760077A72B /* Build configuration list for PBXNativeTarget "MHNatGeoViewControllerTransitionDemoTests" */; 227 | buildPhases = ( 228 | 99543E1D1761B6760077A72B /* Sources */, 229 | 99543E1E1761B6760077A72B /* Frameworks */, 230 | 99543E1F1761B6760077A72B /* Resources */, 231 | 99543E201761B6760077A72B /* ShellScript */, 232 | ); 233 | buildRules = ( 234 | ); 235 | dependencies = ( 236 | 99543E281761B6760077A72B /* PBXTargetDependency */, 237 | ); 238 | name = MHNatGeoViewControllerTransitionDemoTests; 239 | productName = MHNatGeoViewControllerTransitionDemoTests; 240 | productReference = 99543E221761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests.octest */; 241 | productType = "com.apple.product-type.bundle"; 242 | }; 243 | /* End PBXNativeTarget section */ 244 | 245 | /* Begin PBXProject section */ 246 | 99543DF41761B6740077A72B /* Project object */ = { 247 | isa = PBXProject; 248 | attributes = { 249 | LastUpgradeCheck = 0460; 250 | ORGANIZATIONNAME = "Michael Henry Pantaleon"; 251 | }; 252 | buildConfigurationList = 99543DF71761B6740077A72B /* Build configuration list for PBXProject "MHNatGeoViewControllerTransitionDemo" */; 253 | compatibilityVersion = "Xcode 3.2"; 254 | developmentRegion = English; 255 | hasScannedForEncodings = 0; 256 | knownRegions = ( 257 | en, 258 | ); 259 | mainGroup = 99543DF31761B6740077A72B; 260 | productRefGroup = 99543DFD1761B6740077A72B /* Products */; 261 | projectDirPath = ""; 262 | projectRoot = ""; 263 | targets = ( 264 | 99543DFB1761B6740077A72B /* MHNatGeoViewControllerTransitionDemo */, 265 | 99543E211761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests */, 266 | ); 267 | }; 268 | /* End PBXProject section */ 269 | 270 | /* Begin PBXResourcesBuildPhase section */ 271 | 99543DFA1761B6740077A72B /* Resources */ = { 272 | isa = PBXResourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | 99543E0A1761B6740077A72B /* InfoPlist.strings in Resources */, 276 | 99543E121761B6750077A72B /* Default.png in Resources */, 277 | 99543E141761B6750077A72B /* Default@2x.png in Resources */, 278 | 99543E161761B6750077A72B /* Default-568h@2x.png in Resources */, 279 | 99543E191761B6750077A72B /* MainStoryboard.storyboard in Resources */, 280 | 993FDE33176436AF00CF623A /* destination.png in Resources */, 281 | 993FDE34176436B000CF623A /* final.png in Resources */, 282 | 993FDE35176436B000CF623A /* final@2x.png in Resources */, 283 | 993FDE36176436B000CF623A /* source.png in Resources */, 284 | 993FDE39176436CA00CF623A /* destination@2x.png in Resources */, 285 | 993FDE3A176436CA00CF623A /* source@2x.png in Resources */, 286 | ); 287 | runOnlyForDeploymentPostprocessing = 0; 288 | }; 289 | 99543E1F1761B6760077A72B /* Resources */ = { 290 | isa = PBXResourcesBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | 99543E2E1761B6760077A72B /* InfoPlist.strings in Resources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | /* End PBXResourcesBuildPhase section */ 298 | 299 | /* Begin PBXShellScriptBuildPhase section */ 300 | 99543E201761B6760077A72B /* ShellScript */ = { 301 | isa = PBXShellScriptBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | ); 305 | inputPaths = ( 306 | ); 307 | outputPaths = ( 308 | ); 309 | runOnlyForDeploymentPostprocessing = 0; 310 | shellPath = /bin/sh; 311 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 312 | }; 313 | /* End PBXShellScriptBuildPhase section */ 314 | 315 | /* Begin PBXSourcesBuildPhase section */ 316 | 99543DF81761B6740077A72B /* Sources */ = { 317 | isa = PBXSourcesBuildPhase; 318 | buildActionMask = 2147483647; 319 | files = ( 320 | 99543E0C1761B6740077A72B /* main.m in Sources */, 321 | 99543E101761B6740077A72B /* AppDelegate.m in Sources */, 322 | 99543E3F1761B6E50077A72B /* MHNatGeoSegue.m in Sources */, 323 | 99543E401761B6E50077A72B /* MHNatGeoViewControllerTransition.m in Sources */, 324 | 99543E521761C93E0077A72B /* DemoWithPresentAndDismissViewController.m in Sources */, 325 | ); 326 | runOnlyForDeploymentPostprocessing = 0; 327 | }; 328 | 99543E1D1761B6760077A72B /* Sources */ = { 329 | isa = PBXSourcesBuildPhase; 330 | buildActionMask = 2147483647; 331 | files = ( 332 | 99543E311761B6760077A72B /* MHNatGeoViewControllerTransitionDemoTests.m in Sources */, 333 | ); 334 | runOnlyForDeploymentPostprocessing = 0; 335 | }; 336 | /* End PBXSourcesBuildPhase section */ 337 | 338 | /* Begin PBXTargetDependency section */ 339 | 99543E281761B6760077A72B /* PBXTargetDependency */ = { 340 | isa = PBXTargetDependency; 341 | target = 99543DFB1761B6740077A72B /* MHNatGeoViewControllerTransitionDemo */; 342 | targetProxy = 99543E271761B6760077A72B /* PBXContainerItemProxy */; 343 | }; 344 | /* End PBXTargetDependency section */ 345 | 346 | /* Begin PBXVariantGroup section */ 347 | 99543E081761B6740077A72B /* InfoPlist.strings */ = { 348 | isa = PBXVariantGroup; 349 | children = ( 350 | 99543E091761B6740077A72B /* en */, 351 | ); 352 | name = InfoPlist.strings; 353 | sourceTree = ""; 354 | }; 355 | 99543E171761B6750077A72B /* MainStoryboard.storyboard */ = { 356 | isa = PBXVariantGroup; 357 | children = ( 358 | 99543E181761B6750077A72B /* en */, 359 | ); 360 | name = MainStoryboard.storyboard; 361 | sourceTree = ""; 362 | }; 363 | 99543E2C1761B6760077A72B /* InfoPlist.strings */ = { 364 | isa = PBXVariantGroup; 365 | children = ( 366 | 99543E2D1761B6760077A72B /* en */, 367 | ); 368 | name = InfoPlist.strings; 369 | sourceTree = ""; 370 | }; 371 | /* End PBXVariantGroup section */ 372 | 373 | /* Begin XCBuildConfiguration section */ 374 | 99543E321761B6760077A72B /* Debug */ = { 375 | isa = XCBuildConfiguration; 376 | buildSettings = { 377 | ALWAYS_SEARCH_USER_PATHS = NO; 378 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 379 | CLANG_CXX_LIBRARY = "libc++"; 380 | CLANG_ENABLE_OBJC_ARC = YES; 381 | CLANG_WARN_CONSTANT_CONVERSION = YES; 382 | CLANG_WARN_EMPTY_BODY = YES; 383 | CLANG_WARN_ENUM_CONVERSION = YES; 384 | CLANG_WARN_INT_CONVERSION = YES; 385 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 386 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 387 | COPY_PHASE_STRIP = NO; 388 | GCC_C_LANGUAGE_STANDARD = gnu99; 389 | GCC_DYNAMIC_NO_PIC = NO; 390 | GCC_OPTIMIZATION_LEVEL = 0; 391 | GCC_PREPROCESSOR_DEFINITIONS = ( 392 | "DEBUG=1", 393 | "$(inherited)", 394 | ); 395 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 396 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 397 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 398 | GCC_WARN_UNUSED_VARIABLE = YES; 399 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 400 | ONLY_ACTIVE_ARCH = YES; 401 | SDKROOT = iphoneos; 402 | }; 403 | name = Debug; 404 | }; 405 | 99543E331761B6760077A72B /* Release */ = { 406 | isa = XCBuildConfiguration; 407 | buildSettings = { 408 | ALWAYS_SEARCH_USER_PATHS = NO; 409 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 410 | CLANG_CXX_LIBRARY = "libc++"; 411 | CLANG_ENABLE_OBJC_ARC = YES; 412 | CLANG_WARN_CONSTANT_CONVERSION = YES; 413 | CLANG_WARN_EMPTY_BODY = YES; 414 | CLANG_WARN_ENUM_CONVERSION = YES; 415 | CLANG_WARN_INT_CONVERSION = YES; 416 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 417 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 418 | COPY_PHASE_STRIP = YES; 419 | GCC_C_LANGUAGE_STANDARD = gnu99; 420 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 421 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 422 | GCC_WARN_UNUSED_VARIABLE = YES; 423 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 424 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 425 | SDKROOT = iphoneos; 426 | VALIDATE_PRODUCT = YES; 427 | }; 428 | name = Release; 429 | }; 430 | 99543E351761B6760077A72B /* Debug */ = { 431 | isa = XCBuildConfiguration; 432 | buildSettings = { 433 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 434 | GCC_PREFIX_HEADER = "MHNatGeoViewControllerTransitionDemo/MHNatGeoViewControllerTransitionDemo-Prefix.pch"; 435 | INFOPLIST_FILE = "MHNatGeoViewControllerTransitionDemo/MHNatGeoViewControllerTransitionDemo-Info.plist"; 436 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 437 | PRODUCT_NAME = "$(TARGET_NAME)"; 438 | WRAPPER_EXTENSION = app; 439 | }; 440 | name = Debug; 441 | }; 442 | 99543E361761B6760077A72B /* Release */ = { 443 | isa = XCBuildConfiguration; 444 | buildSettings = { 445 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 446 | GCC_PREFIX_HEADER = "MHNatGeoViewControllerTransitionDemo/MHNatGeoViewControllerTransitionDemo-Prefix.pch"; 447 | INFOPLIST_FILE = "MHNatGeoViewControllerTransitionDemo/MHNatGeoViewControllerTransitionDemo-Info.plist"; 448 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 449 | PRODUCT_NAME = "$(TARGET_NAME)"; 450 | WRAPPER_EXTENSION = app; 451 | }; 452 | name = Release; 453 | }; 454 | 99543E381761B6760077A72B /* Debug */ = { 455 | isa = XCBuildConfiguration; 456 | buildSettings = { 457 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MHNatGeoViewControllerTransitionDemo.app/MHNatGeoViewControllerTransitionDemo"; 458 | FRAMEWORK_SEARCH_PATHS = ( 459 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 460 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 461 | ); 462 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 463 | GCC_PREFIX_HEADER = "MHNatGeoViewControllerTransitionDemo/MHNatGeoViewControllerTransitionDemo-Prefix.pch"; 464 | INFOPLIST_FILE = "MHNatGeoViewControllerTransitionDemoTests/MHNatGeoViewControllerTransitionDemoTests-Info.plist"; 465 | PRODUCT_NAME = "$(TARGET_NAME)"; 466 | TEST_HOST = "$(BUNDLE_LOADER)"; 467 | WRAPPER_EXTENSION = octest; 468 | }; 469 | name = Debug; 470 | }; 471 | 99543E391761B6760077A72B /* Release */ = { 472 | isa = XCBuildConfiguration; 473 | buildSettings = { 474 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MHNatGeoViewControllerTransitionDemo.app/MHNatGeoViewControllerTransitionDemo"; 475 | FRAMEWORK_SEARCH_PATHS = ( 476 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 477 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 478 | ); 479 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 480 | GCC_PREFIX_HEADER = "MHNatGeoViewControllerTransitionDemo/MHNatGeoViewControllerTransitionDemo-Prefix.pch"; 481 | INFOPLIST_FILE = "MHNatGeoViewControllerTransitionDemoTests/MHNatGeoViewControllerTransitionDemoTests-Info.plist"; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | TEST_HOST = "$(BUNDLE_LOADER)"; 484 | WRAPPER_EXTENSION = octest; 485 | }; 486 | name = Release; 487 | }; 488 | /* End XCBuildConfiguration section */ 489 | 490 | /* Begin XCConfigurationList section */ 491 | 99543DF71761B6740077A72B /* Build configuration list for PBXProject "MHNatGeoViewControllerTransitionDemo" */ = { 492 | isa = XCConfigurationList; 493 | buildConfigurations = ( 494 | 99543E321761B6760077A72B /* Debug */, 495 | 99543E331761B6760077A72B /* Release */, 496 | ); 497 | defaultConfigurationIsVisible = 0; 498 | defaultConfigurationName = Release; 499 | }; 500 | 99543E341761B6760077A72B /* Build configuration list for PBXNativeTarget "MHNatGeoViewControllerTransitionDemo" */ = { 501 | isa = XCConfigurationList; 502 | buildConfigurations = ( 503 | 99543E351761B6760077A72B /* Debug */, 504 | 99543E361761B6760077A72B /* Release */, 505 | ); 506 | defaultConfigurationIsVisible = 0; 507 | defaultConfigurationName = Release; 508 | }; 509 | 99543E371761B6760077A72B /* Build configuration list for PBXNativeTarget "MHNatGeoViewControllerTransitionDemoTests" */ = { 510 | isa = XCConfigurationList; 511 | buildConfigurations = ( 512 | 99543E381761B6760077A72B /* Debug */, 513 | 99543E391761B6760077A72B /* Release */, 514 | ); 515 | defaultConfigurationIsVisible = 0; 516 | defaultConfigurationName = Release; 517 | }; 518 | /* End XCConfigurationList section */ 519 | }; 520 | rootObject = 99543DF41761B6740077A72B /* Project object */; 521 | } 522 | -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // MHNatGeoViewControllerTransitionDemo 4 | // 5 | // Created by Michael henry Pantaleon on 6/7/13. 6 | // Copyright (c) 2013 Michael Henry Pantaleon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // MHNatGeoViewControllerTransitionDemo 4 | // 5 | // Created by Michael henry Pantaleon on 6/7/13. 6 | // Copyright (c) 2013 Michael Henry Pantaleon. 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 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // 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. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelhenry/MHNatGeoViewControllerTransition/447b24fd68f9aea4c0cf2078abe1f2a33b6c98d3/Demo/MHNatGeoViewControllerTransitionDemo/Default-568h@2x.png -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelhenry/MHNatGeoViewControllerTransition/447b24fd68f9aea4c0cf2078abe1f2a33b6c98d3/Demo/MHNatGeoViewControllerTransitionDemo/Default.png -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelhenry/MHNatGeoViewControllerTransition/447b24fd68f9aea4c0cf2078abe1f2a33b6c98d3/Demo/MHNatGeoViewControllerTransitionDemo/Default@2x.png -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/DemoWithPresentAndDismissViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DemoWithPresentAndDismissViewController.h 3 | // MHNatGeoViewControllerTransitionDemo 4 | // 5 | // Created by Michael henry Pantaleon on 6/7/13. 6 | // Copyright (c) 2013 Michael Henry Pantaleon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DemoWithPresentAndDismissViewController : UIViewController 12 | - (IBAction)dismiss:(UIButton *)sender; 13 | - (IBAction)presentProgrammatically:(UIButton *)sender; 14 | @end 15 | -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/DemoWithPresentAndDismissViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoWithPresentAndDismissViewController.m 3 | // MHNatGeoViewControllerTransitionDemo 4 | // 5 | // Created by Michael henry Pantaleon on 6/7/13. 6 | // Copyright (c) 2013 Michael Henry Pantaleon. All rights reserved. 7 | // 8 | 9 | #import "DemoWithPresentAndDismissViewController.h" 10 | #import "MHNatGeoViewControllerTransition.h" 11 | @interface DemoWithPresentAndDismissViewController () 12 | 13 | @end 14 | 15 | @implementation DemoWithPresentAndDismissViewController 16 | 17 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 18 | { 19 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 20 | if (self) { 21 | // Custom initialization 22 | } 23 | return self; 24 | } 25 | 26 | - (void)viewDidLoad 27 | { 28 | [super viewDidLoad]; 29 | 30 | // Do any additional setup after loading the view. 31 | } 32 | 33 | - (void)didReceiveMemoryWarning 34 | { 35 | [super didReceiveMemoryWarning]; 36 | // Dispose of any resources that can be recreated. 37 | } 38 | 39 | - (IBAction)dismiss:(UIButton *)sender { 40 | [self dismissNatGeoViewControllerWithCompletion:^(BOOL finished) { 41 | NSLog(@"Dismiss complete!"); 42 | }]; 43 | } 44 | 45 | - (IBAction)presentProgrammatically:(UIButton *)sender { 46 | DemoWithPresentAndDismissViewController * demoVC = [self.storyboard instantiateViewControllerWithIdentifier:@"demoVC"]; 47 | [self presentNatGeoViewController:demoVC completion:^(BOOL finished) { 48 | NSLog(@"Present complete!"); 49 | }]; 50 | 51 | } 52 | @end 53 | -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/MHNatGeoViewControllerTransitionDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | net.iamkel.${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 | MainStoryboard 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/MHNatGeoViewControllerTransitionDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'MHNatGeoViewControllerTransitionDemo' target in the 'MHNatGeoViewControllerTransitionDemo' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_5_0 8 | #warning "This project uses features only available in iOS SDK 5.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/destination.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelhenry/MHNatGeoViewControllerTransition/447b24fd68f9aea4c0cf2078abe1f2a33b6c98d3/Demo/MHNatGeoViewControllerTransitionDemo/destination.png -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/destination@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelhenry/MHNatGeoViewControllerTransition/447b24fd68f9aea4c0cf2078abe1f2a33b6c98d3/Demo/MHNatGeoViewControllerTransitionDemo/destination@2x.png -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/en.lproj/MainStoryboard.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 69 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 119 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 169 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 216 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 266 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 316 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 366 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelhenry/MHNatGeoViewControllerTransition/447b24fd68f9aea4c0cf2078abe1f2a33b6c98d3/Demo/MHNatGeoViewControllerTransitionDemo/final.png -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/final@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelhenry/MHNatGeoViewControllerTransition/447b24fd68f9aea4c0cf2078abe1f2a33b6c98d3/Demo/MHNatGeoViewControllerTransitionDemo/final@2x.png -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MHNatGeoViewControllerTransitionDemo 4 | // 5 | // Created by Michael henry Pantaleon on 6/7/13. 6 | // Copyright (c) 2013 Michael Henry Pantaleon. 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 | -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelhenry/MHNatGeoViewControllerTransition/447b24fd68f9aea4c0cf2078abe1f2a33b6c98d3/Demo/MHNatGeoViewControllerTransitionDemo/source.png -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemo/source@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelhenry/MHNatGeoViewControllerTransition/447b24fd68f9aea4c0cf2078abe1f2a33b6c98d3/Demo/MHNatGeoViewControllerTransitionDemo/source@2x.png -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemoTests/MHNatGeoViewControllerTransitionDemoTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | net.iamkel.${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 | -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemoTests/MHNatGeoViewControllerTransitionDemoTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // MHNatGeoViewControllerTransitionDemoTests.h 3 | // MHNatGeoViewControllerTransitionDemoTests 4 | // 5 | // Created by Michael henry Pantaleon on 6/7/13. 6 | // Copyright (c) 2013 Michael Henry Pantaleon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MHNatGeoViewControllerTransitionDemoTests : SenTestCase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemoTests/MHNatGeoViewControllerTransitionDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // MHNatGeoViewControllerTransitionDemoTests.m 3 | // MHNatGeoViewControllerTransitionDemoTests 4 | // 5 | // Created by Michael henry Pantaleon on 6/7/13. 6 | // Copyright (c) 2013 Michael Henry Pantaleon. All rights reserved. 7 | // 8 | 9 | #import "MHNatGeoViewControllerTransitionDemoTests.h" 10 | 11 | @implementation MHNatGeoViewControllerTransitionDemoTests 12 | 13 | - (void)setUp 14 | { 15 | [super setUp]; 16 | 17 | // Set-up code here. 18 | } 19 | 20 | - (void)tearDown 21 | { 22 | // Tear-down code here. 23 | 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample 28 | { 29 | STFail(@"Unit tests are not implemented yet in MHNatGeoViewControllerTransitionDemoTests"); 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Demo/MHNatGeoViewControllerTransitionDemoTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Michael Henry Pantaleon (http://www.iamkel.net). All rights reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /MHNatGeoViewControllerTransition.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'MHNatGeoViewControllerTransition' 3 | s.version = '1.0' 4 | s.platform = :ios 5 | s.license = 'MIT' 6 | s.summary = 'A new ViewController Transition.' 7 | s.homepage = 'https://github.com/michaelhenry/MHNatGeoViewControllerTransition' 8 | s.author = { 'Michael Henry Pantaleon' => 'michaelhenry119@yahoo.com.ph' } 9 | s.source = { :git => 'https://github.com/michaelhenry/MHNatGeoViewControllerTransition.git', 10 | :tag => '1.0' } 11 | 12 | s.description = 'A new ViewController transition inspired by NatGeo City Guides by National Geographic' 13 | 14 | s.requires_arc = true 15 | s.framework = 'QuartzCore' 16 | s.source_files = 'MHNatGeoViewControllerTransition/*.{h,m}' 17 | end 18 | -------------------------------------------------------------------------------- /MHNatGeoViewControllerTransition/MHNatGeoSegue.h: -------------------------------------------------------------------------------- 1 | // 2 | // MHNatGeoSegue.h 3 | // 4 | // Version 1.0 5 | // 6 | // Copyright (c) 2013 Michael Henry Pantaleon (http://www.iamkel.net). All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface MHNatGeoSegue : UIStoryboardSegue 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /MHNatGeoViewControllerTransition/MHNatGeoSegue.m: -------------------------------------------------------------------------------- 1 | // 2 | // MHNatGeoSegue.m 3 | // 4 | // Version 1.0 5 | // 6 | // Copyright (c) 2013 Michael Henry Pantaleon (http://www.iamkel.net). All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "MHNatGeoSegue.h" 28 | #import "MHNatGeoViewControllerTransition.h" 29 | @implementation MHNatGeoSegue 30 | 31 | - (void) perform { 32 | [[self sourceViewController]presentNatGeoViewController:[self destinationViewController] completion:nil]; 33 | } 34 | @end 35 | -------------------------------------------------------------------------------- /MHNatGeoViewControllerTransition/MHNatGeoViewControllerTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // MHNatGeoViewControllerTransition.h 3 | // 4 | // Version 1.0 5 | // 6 | // Copyright (c) 2013 Michael Henry Pantaleon (http://www.iamkel.net). All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface MHNatGeoViewControllerTransition : NSObject 29 | 30 | @property (assign, nonatomic, getter = isDimissing) BOOL dismissing; 31 | 32 | @property (strong, nonatomic) UIView *sourceView; 33 | @property (strong, nonatomic) UIView *destinationView; 34 | @property (assign, nonatomic) NSTimeInterval duration; 35 | 36 | - (id)initWithSourceView:(UIView *)sourceView destinationView:(UIView *)destinationView duration:(NSTimeInterval)duration; 37 | - (void)perform; 38 | - (void)perform:(void (^)(BOOL finished))completion; 39 | + (void) presentViewControllerTransition:(UIViewController*)destination source:(UIViewController*)source duration:(NSTimeInterval) duration completion:(void (^)(BOOL finished))completion; 40 | + (void)dismissViewController:(UIViewController *)viewController duration:(NSTimeInterval)duration completion:(void (^)(BOOL finished))completion; 41 | 42 | @end 43 | 44 | #pragma mark - UIViewController(MHNatGeoViewControllerTransition) 45 | @interface UIViewController(MHNatGeoViewControllerTransition) 46 | 47 | @property(nonatomic,retain) UIViewController * presentedFromViewController; 48 | 49 | - (void)presentNatGeoViewController:(UIViewController *)viewController completion:(void (^)(BOOL finished))completion; 50 | - (void)presentNatGeoViewController:(UIViewController *)viewController; 51 | -(void) dismissNatGeoViewControllerWithCompletion:(void (^)(BOOL finished))completion; 52 | -(void) dismissNatGeoViewController; 53 | 54 | @end; -------------------------------------------------------------------------------- /MHNatGeoViewControllerTransition/MHNatGeoViewControllerTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // MHNatGeoViewControllerTransition.m 3 | // 4 | // Version 1.0 5 | // 6 | // Copyright (c) 2013 Michael Henry Pantaleon (http://www.iamkel.net). All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "MHNatGeoViewControllerTransition.h" 27 | #import 28 | #import 29 | 30 | @interface MHNatGeoViewControllerTransition() 31 | 32 | @end 33 | 34 | @implementation MHNatGeoViewControllerTransition 35 | @synthesize sourceView = _sourceView; 36 | @synthesize destinationView = _destinationView; 37 | @synthesize duration = _duration; 38 | @synthesize dismissing = _dismissing; 39 | 40 | - (id)initWithSourceView:(UIView *)sourceView destinationView:(UIView *)destinationView duration:(NSTimeInterval)duration { 41 | self = [super init]; 42 | if(self) { 43 | _sourceView = sourceView; 44 | _destinationView = destinationView; 45 | _duration = duration; 46 | } 47 | return self; 48 | } 49 | 50 | - (void) perform { 51 | [self perform:nil]; 52 | } 53 | 54 | - (void)perform:(void (^)(BOOL finished))completion { 55 | 56 | if ([self isDimissing]) { 57 | // Reset to initial transform 58 | sourceLastTransform([_sourceView layer]); 59 | destinationLastTransform([_destinationView layer]); 60 | 61 | 62 | //Perform animation 63 | [UIView animateWithDuration:0.8f*_duration delay:0.2f*_duration options:UIViewAnimationOptionCurveLinear animations:^{ 64 | destinationFirstTransform([_destinationView layer]); 65 | } completion:^(BOOL finished) { 66 | completion(YES); 67 | 68 | }]; 69 | 70 | [UIView animateWithDuration:_duration delay:0.0f options:0 animations:^{ 71 | sourceFirstTransform([_sourceView layer]); 72 | } completion:^(BOOL finished) { 73 | CGRect oldFrame = [[_sourceView layer]frame]; 74 | [[_sourceView layer]setAnchorPoint:CGPointMake(0.5,0.5f)]; 75 | [[_sourceView layer] setFrame:oldFrame]; 76 | }]; 77 | }else { 78 | // Change anchor point and reposition it. 79 | CGRect oldFrame = [[_sourceView layer]frame]; 80 | [[_sourceView layer]setAnchorPoint:CGPointMake(0.0,0.5f)]; 81 | [[_sourceView layer] setFrame:oldFrame]; 82 | 83 | // Reset to initial transform 84 | sourceFirstTransform([_sourceView layer]); 85 | destinationFirstTransform([_destinationView layer]); 86 | 87 | //Perform animation 88 | [UIView animateWithDuration:_duration delay:0.0f options:0 animations:^{ 89 | destinationLastTransform([_destinationView layer]); 90 | } completion:^(BOOL finished) { 91 | 92 | }]; 93 | 94 | [UIView animateWithDuration:0.8*_duration delay:0.2*_duration options:0 animations:^{ 95 | sourceLastTransform([_sourceView layer]); 96 | } completion:^(BOOL finished) { 97 | completion(YES); 98 | }]; 99 | } 100 | } 101 | 102 | 103 | #pragma mark - Required 3d Transform 104 | void sourceFirstTransform(CALayer *layer) { 105 | CATransform3D t = CATransform3DIdentity; 106 | t.m34 = 1.0/ -500; 107 | t = CATransform3DTranslate(t, 0.0f, 0.0f, 0.0f); 108 | layer.transform = t; 109 | } 110 | 111 | void sourceLastTransform(CALayer *layer) { 112 | CATransform3D t = CATransform3DIdentity; 113 | t.m34 = 1.0/ -500; 114 | t = CATransform3DRotate(t, radianFromDegree(80), 0.0f,1.0f, 0.0f); 115 | t = CATransform3DTranslate(t, 0.0f, 0.0f, -30.0f); 116 | t = CATransform3DTranslate(t,170.0f, 0.0f, 0.0f); 117 | layer.transform = t; 118 | } 119 | 120 | void destinationFirstTransform(CALayer * layer) { 121 | CATransform3D t = CATransform3DIdentity; 122 | t.m34 = 1.0/ -500; 123 | // Rotate 5 degrees within the axis of z axis 124 | t = CATransform3DRotate(t, radianFromDegree(5.0f), 0.0f,0.0f, 1.0f); 125 | // Reposition toward to the left where it initialized 126 | t = CATransform3DTranslate(t, 320.0f, -40.0f, 150.0f); 127 | // Rotate it -45 degrees within the y axis 128 | t = CATransform3DRotate(t, radianFromDegree(-45), 0.0f,1.0f, 0.0f); 129 | // Rotate it 10 degrees within thee x axis 130 | t = CATransform3DRotate(t, radianFromDegree(10), 1.0f,0.0f, 0.0f); 131 | layer.transform = t; 132 | } 133 | 134 | void destinationLastTransform(CALayer * layer) { 135 | CATransform3D t = CATransform3DIdentity; 136 | t.m34 = 1.0/ -500; 137 | // Rotate to 0 degrees within z axis 138 | t = CATransform3DRotate(t, radianFromDegree(0), 0.0f,0.0f, 1.0f); 139 | // Bring back to the final position 140 | t = CATransform3DTranslate(t, 0.0f, 0.0f, 0.0f); 141 | // Rotate 0 degrees within y axis 142 | t = CATransform3DRotate(t, radianFromDegree(0), 0.0f,1.0f, 0.0f); 143 | // Rotate 0 degrees within x axis 144 | t = CATransform3DRotate(t, radianFromDegree(0), 1.0f,0.0f, 0.0f); 145 | layer.transform = t; 146 | } 147 | 148 | #pragma mark - Convert Degrees to Radian 149 | double radianFromDegree(float degrees) { 150 | return (degrees / 180) * M_PI; 151 | } 152 | 153 | #pragma mark - ViewController Transition 154 | + (void) presentViewControllerTransition:(UIViewController*)destination source:(UIViewController*)source duration:(NSTimeInterval) duration completion:(void (^)(BOOL finished))completion{ 155 | 156 | __block UIView * destinationView = [destination view]; 157 | destinationView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; 158 | [[[[UIApplication sharedApplication]delegate]window]addSubview:destinationView]; 159 | MHNatGeoViewControllerTransition * natGeoTransition = [[MHNatGeoViewControllerTransition alloc]initWithSourceView:[source view] destinationView:[destination view] duration:duration]; 160 | [natGeoTransition perform:^(BOOL finished) { 161 | [destination setPresentedFromViewController:source]; 162 | [destinationView removeFromSuperview]; 163 | destinationView = nil; 164 | [source presentViewController:destination animated:NO completion:^{ 165 | if (completion) 166 | completion(YES); 167 | }]; 168 | }]; 169 | } 170 | 171 | + (void)dismissViewController:(UIViewController *)viewController duration:(NSTimeInterval)duration completion:(void (^)(BOOL finished))completion 172 | { 173 | __block UIView * sourceView = [viewController.presentedFromViewController view]; 174 | sourceView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; 175 | [[[[UIApplication sharedApplication]delegate]window]addSubview:sourceView]; 176 | MHNatGeoViewControllerTransition * natGeoTransition = [[MHNatGeoViewControllerTransition alloc]initWithSourceView:sourceView destinationView:[viewController view] duration:duration]; 177 | [natGeoTransition setDismissing:YES]; 178 | [natGeoTransition perform:^(BOOL finished) { 179 | if(finished){ 180 | [viewController setPresentedFromViewController:nil]; 181 | [viewController dismissViewControllerAnimated:NO completion:^{ 182 | if (completion) 183 | completion(YES); 184 | }]; 185 | } 186 | }]; 187 | } 188 | 189 | @end 190 | 191 | 192 | #pragma mark - UIViewController(MHNatGeoViewControllerTransition) 193 | @implementation UIViewController(MHNatGeoViewControllerTransition) 194 | 195 | @dynamic presentedFromViewController; 196 | 197 | - (void)presentNatGeoViewController:(UIViewController *)viewController completion:(void (^)(BOOL finished))completion 198 | { 199 | [MHNatGeoViewControllerTransition presentViewControllerTransition:viewController source:self duration:0.6f completion:completion]; 200 | } 201 | 202 | - (void)presentNatGeoViewController:(UIViewController *)viewController { 203 | [self presentNatGeoViewController:viewController completion:nil]; 204 | } 205 | 206 | -(void) dismissNatGeoViewControllerWithCompletion:(void (^)(BOOL finished))completion { 207 | [MHNatGeoViewControllerTransition dismissViewController:self duration:0.5f completion:completion]; 208 | } 209 | 210 | - (void) dismissNatGeoViewController { 211 | [self dismissNatGeoViewControllerWithCompletion:nil]; 212 | } 213 | 214 | static char presentedFromViewControllerKey; 215 | 216 | - (void) setPresentedFromViewController:(UIViewController *)viewController { 217 | [self willChangeValueForKey:@"natGeoPresentedFromViewController"]; 218 | objc_setAssociatedObject( self, 219 | &presentedFromViewControllerKey, 220 | viewController, 221 | OBJC_ASSOCIATION_RETAIN ); 222 | 223 | [self didChangeValueForKey:@"natGeoPresentedFromViewController"]; 224 | } 225 | 226 | - (UIViewController*) presentedFromViewController { 227 | id controller = objc_getAssociatedObject( self, 228 | &presentedFromViewControllerKey ); 229 | return controller; 230 | } 231 | 232 | @end 233 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MHNatGeoViewControllerTransition 2 | ================================ 3 | 4 | A new ViewController transition inspired by NatGeo [City Guides by National Geographic](https://itunes.apple.com/us/app/city-guides-by-national-geographic/id592453480?mt=8) 5 | 6 | 7 | # Demo 8 | 9 | ![Preview](http://i1102.photobucket.com/albums/g447/michaelhenry119/IOS%20Controls/MHNatGeoViewControllerTransition/MHNatGeo_zps8506e2be.gif) 10 | 11 | 12 | # Features 13 | 14 | Easy integration 15 | 16 | Can be use as segue 17 | 18 | 19 | # Requirements 20 | 21 | Requires either iOS 5.0 and above. 22 | 23 | 24 | # Usage 25 | 26 | ## How to Present a ViewController 27 | 28 | ### Using Storyboard Segue 29 | 30 | Just simply drag the from Source to Destination and select *nat geo* Segue (see screenshots below) 31 | 32 | ![Preview](http://i1102.photobucket.com/albums/g447/michaelhenry119/IOS%20Controls/MHNatGeoViewControllerTransition/ScreenShot2013-06-09at123039PM_zps66f45f08.png) 33 | 34 | ![Preview](http://i1102.photobucket.com/albums/g447/michaelhenry119/IOS%20Controls/MHNatGeoViewControllerTransition/ScreenShot2013-06-09at123123PM_zpsd131f70d.png) 35 | 36 | ### Present Programmatically 37 | 38 | Just 39 | 40 | #import "MHNatGeoViewControllerTransition.h" 41 | 42 | and then 43 | 44 | [self presentNatGeoViewController:demoViewController]; 45 | 46 | or you can use the completion block, 47 | 48 | [self presentNatGeoViewController:demoViewController completion:^(BOOL finished) { 49 | NSLog(@"Present complete!"); 50 | }]; 51 | 52 | ## How to dismiss a ViewController 53 | 54 | Just 55 | 56 | #import "MHNatGeoViewControllerTransition.h" 57 | 58 | and then 59 | 60 | [self dismissNatGeoViewController]; 61 | 62 | or you can use the completion block, 63 | 64 | [self dismissNatGeoViewControllerWithCompletion:^(BOOL finished) { 65 | NSLog(@"Dismiss complete!"); 66 | }]; 67 | 68 | 69 | # Is it Easy? :) 70 | 71 | 72 | Please let me know if you have any questions. 73 | 74 | Cheers, 75 | [Michael Henry Pantaleon](http://www.iamkel.net) 76 | 77 | Twitter: [@michaelhenry119](https://twitter.com/michaelhenry119) 78 | 79 | Linked in: [ken119](http://ph.linkedin.com/in/ken119) 80 | 81 | http://www.iamkel.net 82 | 83 | 84 | 85 | # Licensing 86 | 87 | Copyright (c) 2013 Michael Henry Pantaleon (http://www.iamkel.net). All rights reserved. 88 | 89 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 90 | 91 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 92 | 93 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------