├── .gitignore ├── InteractiveTransition.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── InteractiveTransition.xccheckout ├── InteractiveTransition ├── Base.lproj │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── InteractiveTransition-Info.plist ├── InteractiveTransition-Prefix.pch ├── SCAppDelegate.h ├── SCAppDelegate.m ├── SCDetailViewController.h ├── SCDetailViewController.m ├── SCPercentDrivenInteractiveTransition.h ├── SCPercentDrivenInteractiveTransition.m ├── SCTransition.h ├── SCTransition.m ├── SCViewController.h ├── SCViewController.m ├── en.lproj │ └── InfoPlist.strings └── main.m ├── InteractiveTransitionTests ├── InteractiveTransitionTests-Info.plist ├── InteractiveTransitionTests.m └── en.lproj │ └── InfoPlist.strings └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | temp 4 | master/ 5 | live/ 6 | 7 | *.pbxuser 8 | *.perspective 9 | *.perspectivev3 10 | 11 | *.mode1v3 12 | *.mode2v3 13 | 14 | **/xcuserdata/** 15 | *.xcuserstate 16 | 17 | docset-installed.txt -------------------------------------------------------------------------------- /InteractiveTransition.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9F0010EE18EF025100A0AB17 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F0010ED18EF025100A0AB17 /* Foundation.framework */; }; 11 | 9F0010F018EF025100A0AB17 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F0010EF18EF025100A0AB17 /* CoreGraphics.framework */; }; 12 | 9F0010F218EF025100A0AB17 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F0010F118EF025100A0AB17 /* UIKit.framework */; }; 13 | 9F0010F818EF025100A0AB17 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9F0010F618EF025100A0AB17 /* InfoPlist.strings */; }; 14 | 9F0010FA18EF025100A0AB17 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F0010F918EF025100A0AB17 /* main.m */; }; 15 | 9F0010FE18EF025100A0AB17 /* SCAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F0010FD18EF025100A0AB17 /* SCAppDelegate.m */; }; 16 | 9F00110118EF025100A0AB17 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9F0010FF18EF025100A0AB17 /* Main.storyboard */; }; 17 | 9F00110418EF025100A0AB17 /* SCViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F00110318EF025100A0AB17 /* SCViewController.m */; }; 18 | 9F00110618EF025100A0AB17 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9F00110518EF025100A0AB17 /* Images.xcassets */; }; 19 | 9F00110D18EF025100A0AB17 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F00110C18EF025100A0AB17 /* XCTest.framework */; }; 20 | 9F00110E18EF025100A0AB17 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F0010ED18EF025100A0AB17 /* Foundation.framework */; }; 21 | 9F00110F18EF025100A0AB17 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F0010F118EF025100A0AB17 /* UIKit.framework */; }; 22 | 9F00111718EF025100A0AB17 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9F00111518EF025100A0AB17 /* InfoPlist.strings */; }; 23 | 9F00111918EF025100A0AB17 /* InteractiveTransitionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F00111818EF025100A0AB17 /* InteractiveTransitionTests.m */; }; 24 | 9F00112418EF039300A0AB17 /* SCTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F00112318EF039300A0AB17 /* SCTransition.m */; }; 25 | 9F00112718EF057300A0AB17 /* SCDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F00112618EF057300A0AB17 /* SCDetailViewController.m */; }; 26 | 9F00112D18F0713400A0AB17 /* SCPercentDrivenInteractiveTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F00112C18F0713400A0AB17 /* SCPercentDrivenInteractiveTransition.m */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 9F00111018EF025100A0AB17 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 9F0010E218EF025100A0AB17 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 9F0010E918EF025100A0AB17; 35 | remoteInfo = InteractiveTransition; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 9F0010EA18EF025100A0AB17 /* InteractiveTransition.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = InteractiveTransition.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 9F0010ED18EF025100A0AB17 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 42 | 9F0010EF18EF025100A0AB17 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 43 | 9F0010F118EF025100A0AB17 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 44 | 9F0010F518EF025100A0AB17 /* InteractiveTransition-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "InteractiveTransition-Info.plist"; sourceTree = ""; }; 45 | 9F0010F718EF025100A0AB17 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 46 | 9F0010F918EF025100A0AB17 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 47 | 9F0010FB18EF025100A0AB17 /* InteractiveTransition-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "InteractiveTransition-Prefix.pch"; sourceTree = ""; }; 48 | 9F0010FC18EF025100A0AB17 /* SCAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SCAppDelegate.h; sourceTree = ""; }; 49 | 9F0010FD18EF025100A0AB17 /* SCAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SCAppDelegate.m; sourceTree = ""; }; 50 | 9F00110018EF025100A0AB17 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 51 | 9F00110218EF025100A0AB17 /* SCViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SCViewController.h; sourceTree = ""; }; 52 | 9F00110318EF025100A0AB17 /* SCViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SCViewController.m; sourceTree = ""; }; 53 | 9F00110518EF025100A0AB17 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 54 | 9F00110B18EF025100A0AB17 /* InteractiveTransitionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InteractiveTransitionTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 9F00110C18EF025100A0AB17 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 56 | 9F00111418EF025100A0AB17 /* InteractiveTransitionTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "InteractiveTransitionTests-Info.plist"; sourceTree = ""; }; 57 | 9F00111618EF025100A0AB17 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 58 | 9F00111818EF025100A0AB17 /* InteractiveTransitionTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InteractiveTransitionTests.m; sourceTree = ""; }; 59 | 9F00112218EF039300A0AB17 /* SCTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCTransition.h; sourceTree = ""; }; 60 | 9F00112318EF039300A0AB17 /* SCTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCTransition.m; sourceTree = ""; }; 61 | 9F00112518EF057300A0AB17 /* SCDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCDetailViewController.h; sourceTree = ""; }; 62 | 9F00112618EF057300A0AB17 /* SCDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCDetailViewController.m; sourceTree = ""; }; 63 | 9F00112B18F0713400A0AB17 /* SCPercentDrivenInteractiveTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCPercentDrivenInteractiveTransition.h; sourceTree = ""; }; 64 | 9F00112C18F0713400A0AB17 /* SCPercentDrivenInteractiveTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCPercentDrivenInteractiveTransition.m; sourceTree = ""; }; 65 | /* End PBXFileReference section */ 66 | 67 | /* Begin PBXFrameworksBuildPhase section */ 68 | 9F0010E718EF025100A0AB17 /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | 9F0010F018EF025100A0AB17 /* CoreGraphics.framework in Frameworks */, 73 | 9F0010F218EF025100A0AB17 /* UIKit.framework in Frameworks */, 74 | 9F0010EE18EF025100A0AB17 /* Foundation.framework in Frameworks */, 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | 9F00110818EF025100A0AB17 /* Frameworks */ = { 79 | isa = PBXFrameworksBuildPhase; 80 | buildActionMask = 2147483647; 81 | files = ( 82 | 9F00110D18EF025100A0AB17 /* XCTest.framework in Frameworks */, 83 | 9F00110F18EF025100A0AB17 /* UIKit.framework in Frameworks */, 84 | 9F00110E18EF025100A0AB17 /* Foundation.framework in Frameworks */, 85 | ); 86 | runOnlyForDeploymentPostprocessing = 0; 87 | }; 88 | /* End PBXFrameworksBuildPhase section */ 89 | 90 | /* Begin PBXGroup section */ 91 | 9F0010E118EF025100A0AB17 = { 92 | isa = PBXGroup; 93 | children = ( 94 | 9F0010F318EF025100A0AB17 /* InteractiveTransition */, 95 | 9F00111218EF025100A0AB17 /* InteractiveTransitionTests */, 96 | 9F0010EC18EF025100A0AB17 /* Frameworks */, 97 | 9F0010EB18EF025100A0AB17 /* Products */, 98 | ); 99 | sourceTree = ""; 100 | }; 101 | 9F0010EB18EF025100A0AB17 /* Products */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 9F0010EA18EF025100A0AB17 /* InteractiveTransition.app */, 105 | 9F00110B18EF025100A0AB17 /* InteractiveTransitionTests.xctest */, 106 | ); 107 | name = Products; 108 | sourceTree = ""; 109 | }; 110 | 9F0010EC18EF025100A0AB17 /* Frameworks */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 9F0010ED18EF025100A0AB17 /* Foundation.framework */, 114 | 9F0010EF18EF025100A0AB17 /* CoreGraphics.framework */, 115 | 9F0010F118EF025100A0AB17 /* UIKit.framework */, 116 | 9F00110C18EF025100A0AB17 /* XCTest.framework */, 117 | ); 118 | name = Frameworks; 119 | sourceTree = ""; 120 | }; 121 | 9F0010F318EF025100A0AB17 /* InteractiveTransition */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 9F0010FC18EF025100A0AB17 /* SCAppDelegate.h */, 125 | 9F0010FD18EF025100A0AB17 /* SCAppDelegate.m */, 126 | 9F0010FF18EF025100A0AB17 /* Main.storyboard */, 127 | 9F00110218EF025100A0AB17 /* SCViewController.h */, 128 | 9F00110318EF025100A0AB17 /* SCViewController.m */, 129 | 9F00112518EF057300A0AB17 /* SCDetailViewController.h */, 130 | 9F00112618EF057300A0AB17 /* SCDetailViewController.m */, 131 | 9F00112218EF039300A0AB17 /* SCTransition.h */, 132 | 9F00112318EF039300A0AB17 /* SCTransition.m */, 133 | 9F00112B18F0713400A0AB17 /* SCPercentDrivenInteractiveTransition.h */, 134 | 9F00112C18F0713400A0AB17 /* SCPercentDrivenInteractiveTransition.m */, 135 | 9F00110518EF025100A0AB17 /* Images.xcassets */, 136 | 9F0010F418EF025100A0AB17 /* Supporting Files */, 137 | ); 138 | path = InteractiveTransition; 139 | sourceTree = ""; 140 | }; 141 | 9F0010F418EF025100A0AB17 /* Supporting Files */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 9F0010F518EF025100A0AB17 /* InteractiveTransition-Info.plist */, 145 | 9F0010F618EF025100A0AB17 /* InfoPlist.strings */, 146 | 9F0010F918EF025100A0AB17 /* main.m */, 147 | 9F0010FB18EF025100A0AB17 /* InteractiveTransition-Prefix.pch */, 148 | ); 149 | name = "Supporting Files"; 150 | sourceTree = ""; 151 | }; 152 | 9F00111218EF025100A0AB17 /* InteractiveTransitionTests */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | 9F00111818EF025100A0AB17 /* InteractiveTransitionTests.m */, 156 | 9F00111318EF025100A0AB17 /* Supporting Files */, 157 | ); 158 | path = InteractiveTransitionTests; 159 | sourceTree = ""; 160 | }; 161 | 9F00111318EF025100A0AB17 /* Supporting Files */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | 9F00111418EF025100A0AB17 /* InteractiveTransitionTests-Info.plist */, 165 | 9F00111518EF025100A0AB17 /* InfoPlist.strings */, 166 | ); 167 | name = "Supporting Files"; 168 | sourceTree = ""; 169 | }; 170 | /* End PBXGroup section */ 171 | 172 | /* Begin PBXNativeTarget section */ 173 | 9F0010E918EF025100A0AB17 /* InteractiveTransition */ = { 174 | isa = PBXNativeTarget; 175 | buildConfigurationList = 9F00111C18EF025100A0AB17 /* Build configuration list for PBXNativeTarget "InteractiveTransition" */; 176 | buildPhases = ( 177 | 9F0010E618EF025100A0AB17 /* Sources */, 178 | 9F0010E718EF025100A0AB17 /* Frameworks */, 179 | 9F0010E818EF025100A0AB17 /* Resources */, 180 | ); 181 | buildRules = ( 182 | ); 183 | dependencies = ( 184 | ); 185 | name = InteractiveTransition; 186 | productName = InteractiveTransition; 187 | productReference = 9F0010EA18EF025100A0AB17 /* InteractiveTransition.app */; 188 | productType = "com.apple.product-type.application"; 189 | }; 190 | 9F00110A18EF025100A0AB17 /* InteractiveTransitionTests */ = { 191 | isa = PBXNativeTarget; 192 | buildConfigurationList = 9F00111F18EF025100A0AB17 /* Build configuration list for PBXNativeTarget "InteractiveTransitionTests" */; 193 | buildPhases = ( 194 | 9F00110718EF025100A0AB17 /* Sources */, 195 | 9F00110818EF025100A0AB17 /* Frameworks */, 196 | 9F00110918EF025100A0AB17 /* Resources */, 197 | ); 198 | buildRules = ( 199 | ); 200 | dependencies = ( 201 | 9F00111118EF025100A0AB17 /* PBXTargetDependency */, 202 | ); 203 | name = InteractiveTransitionTests; 204 | productName = InteractiveTransitionTests; 205 | productReference = 9F00110B18EF025100A0AB17 /* InteractiveTransitionTests.xctest */; 206 | productType = "com.apple.product-type.bundle.unit-test"; 207 | }; 208 | /* End PBXNativeTarget section */ 209 | 210 | /* Begin PBXProject section */ 211 | 9F0010E218EF025100A0AB17 /* Project object */ = { 212 | isa = PBXProject; 213 | attributes = { 214 | CLASSPREFIX = SC; 215 | LastUpgradeCheck = 0510; 216 | ORGANIZATIONNAME = "StringCode Ltd"; 217 | TargetAttributes = { 218 | 9F00110A18EF025100A0AB17 = { 219 | TestTargetID = 9F0010E918EF025100A0AB17; 220 | }; 221 | }; 222 | }; 223 | buildConfigurationList = 9F0010E518EF025100A0AB17 /* Build configuration list for PBXProject "InteractiveTransition" */; 224 | compatibilityVersion = "Xcode 3.2"; 225 | developmentRegion = English; 226 | hasScannedForEncodings = 0; 227 | knownRegions = ( 228 | en, 229 | Base, 230 | ); 231 | mainGroup = 9F0010E118EF025100A0AB17; 232 | productRefGroup = 9F0010EB18EF025100A0AB17 /* Products */; 233 | projectDirPath = ""; 234 | projectRoot = ""; 235 | targets = ( 236 | 9F0010E918EF025100A0AB17 /* InteractiveTransition */, 237 | 9F00110A18EF025100A0AB17 /* InteractiveTransitionTests */, 238 | ); 239 | }; 240 | /* End PBXProject section */ 241 | 242 | /* Begin PBXResourcesBuildPhase section */ 243 | 9F0010E818EF025100A0AB17 /* Resources */ = { 244 | isa = PBXResourcesBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | 9F00110618EF025100A0AB17 /* Images.xcassets in Resources */, 248 | 9F0010F818EF025100A0AB17 /* InfoPlist.strings in Resources */, 249 | 9F00110118EF025100A0AB17 /* Main.storyboard in Resources */, 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | 9F00110918EF025100A0AB17 /* Resources */ = { 254 | isa = PBXResourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | 9F00111718EF025100A0AB17 /* InfoPlist.strings in Resources */, 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | }; 261 | /* End PBXResourcesBuildPhase section */ 262 | 263 | /* Begin PBXSourcesBuildPhase section */ 264 | 9F0010E618EF025100A0AB17 /* Sources */ = { 265 | isa = PBXSourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | 9F0010FE18EF025100A0AB17 /* SCAppDelegate.m in Sources */, 269 | 9F00112D18F0713400A0AB17 /* SCPercentDrivenInteractiveTransition.m in Sources */, 270 | 9F00110418EF025100A0AB17 /* SCViewController.m in Sources */, 271 | 9F00112718EF057300A0AB17 /* SCDetailViewController.m in Sources */, 272 | 9F00112418EF039300A0AB17 /* SCTransition.m in Sources */, 273 | 9F0010FA18EF025100A0AB17 /* main.m in Sources */, 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | 9F00110718EF025100A0AB17 /* Sources */ = { 278 | isa = PBXSourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | 9F00111918EF025100A0AB17 /* InteractiveTransitionTests.m in Sources */, 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | /* End PBXSourcesBuildPhase section */ 286 | 287 | /* Begin PBXTargetDependency section */ 288 | 9F00111118EF025100A0AB17 /* PBXTargetDependency */ = { 289 | isa = PBXTargetDependency; 290 | target = 9F0010E918EF025100A0AB17 /* InteractiveTransition */; 291 | targetProxy = 9F00111018EF025100A0AB17 /* PBXContainerItemProxy */; 292 | }; 293 | /* End PBXTargetDependency section */ 294 | 295 | /* Begin PBXVariantGroup section */ 296 | 9F0010F618EF025100A0AB17 /* InfoPlist.strings */ = { 297 | isa = PBXVariantGroup; 298 | children = ( 299 | 9F0010F718EF025100A0AB17 /* en */, 300 | ); 301 | name = InfoPlist.strings; 302 | sourceTree = ""; 303 | }; 304 | 9F0010FF18EF025100A0AB17 /* Main.storyboard */ = { 305 | isa = PBXVariantGroup; 306 | children = ( 307 | 9F00110018EF025100A0AB17 /* Base */, 308 | ); 309 | name = Main.storyboard; 310 | sourceTree = ""; 311 | }; 312 | 9F00111518EF025100A0AB17 /* InfoPlist.strings */ = { 313 | isa = PBXVariantGroup; 314 | children = ( 315 | 9F00111618EF025100A0AB17 /* en */, 316 | ); 317 | name = InfoPlist.strings; 318 | sourceTree = ""; 319 | }; 320 | /* End PBXVariantGroup section */ 321 | 322 | /* Begin XCBuildConfiguration section */ 323 | 9F00111A18EF025100A0AB17 /* Debug */ = { 324 | isa = XCBuildConfiguration; 325 | buildSettings = { 326 | ALWAYS_SEARCH_USER_PATHS = NO; 327 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 328 | CLANG_CXX_LIBRARY = "libc++"; 329 | CLANG_ENABLE_MODULES = YES; 330 | CLANG_ENABLE_OBJC_ARC = YES; 331 | CLANG_WARN_BOOL_CONVERSION = YES; 332 | CLANG_WARN_CONSTANT_CONVERSION = YES; 333 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 334 | CLANG_WARN_EMPTY_BODY = YES; 335 | CLANG_WARN_ENUM_CONVERSION = YES; 336 | CLANG_WARN_INT_CONVERSION = YES; 337 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 338 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 339 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 340 | COPY_PHASE_STRIP = NO; 341 | GCC_C_LANGUAGE_STANDARD = gnu99; 342 | GCC_DYNAMIC_NO_PIC = NO; 343 | GCC_OPTIMIZATION_LEVEL = 0; 344 | GCC_PREPROCESSOR_DEFINITIONS = ( 345 | "DEBUG=1", 346 | "$(inherited)", 347 | ); 348 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 349 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 350 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 351 | GCC_WARN_UNDECLARED_SELECTOR = YES; 352 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 353 | GCC_WARN_UNUSED_FUNCTION = YES; 354 | GCC_WARN_UNUSED_VARIABLE = YES; 355 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 356 | ONLY_ACTIVE_ARCH = YES; 357 | SDKROOT = iphoneos; 358 | }; 359 | name = Debug; 360 | }; 361 | 9F00111B18EF025100A0AB17 /* Release */ = { 362 | isa = XCBuildConfiguration; 363 | buildSettings = { 364 | ALWAYS_SEARCH_USER_PATHS = NO; 365 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 366 | CLANG_CXX_LIBRARY = "libc++"; 367 | CLANG_ENABLE_MODULES = YES; 368 | CLANG_ENABLE_OBJC_ARC = YES; 369 | CLANG_WARN_BOOL_CONVERSION = YES; 370 | CLANG_WARN_CONSTANT_CONVERSION = YES; 371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 372 | CLANG_WARN_EMPTY_BODY = YES; 373 | CLANG_WARN_ENUM_CONVERSION = YES; 374 | CLANG_WARN_INT_CONVERSION = YES; 375 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 376 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 377 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 378 | COPY_PHASE_STRIP = YES; 379 | ENABLE_NS_ASSERTIONS = NO; 380 | GCC_C_LANGUAGE_STANDARD = gnu99; 381 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 382 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 383 | GCC_WARN_UNDECLARED_SELECTOR = YES; 384 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 385 | GCC_WARN_UNUSED_FUNCTION = YES; 386 | GCC_WARN_UNUSED_VARIABLE = YES; 387 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 388 | SDKROOT = iphoneos; 389 | VALIDATE_PRODUCT = YES; 390 | }; 391 | name = Release; 392 | }; 393 | 9F00111D18EF025100A0AB17 /* Debug */ = { 394 | isa = XCBuildConfiguration; 395 | buildSettings = { 396 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 397 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 398 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 399 | GCC_PREFIX_HEADER = "InteractiveTransition/InteractiveTransition-Prefix.pch"; 400 | INFOPLIST_FILE = "InteractiveTransition/InteractiveTransition-Info.plist"; 401 | PRODUCT_NAME = "$(TARGET_NAME)"; 402 | WRAPPER_EXTENSION = app; 403 | }; 404 | name = Debug; 405 | }; 406 | 9F00111E18EF025100A0AB17 /* Release */ = { 407 | isa = XCBuildConfiguration; 408 | buildSettings = { 409 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 410 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 411 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 412 | GCC_PREFIX_HEADER = "InteractiveTransition/InteractiveTransition-Prefix.pch"; 413 | INFOPLIST_FILE = "InteractiveTransition/InteractiveTransition-Info.plist"; 414 | PRODUCT_NAME = "$(TARGET_NAME)"; 415 | WRAPPER_EXTENSION = app; 416 | }; 417 | name = Release; 418 | }; 419 | 9F00112018EF025100A0AB17 /* Debug */ = { 420 | isa = XCBuildConfiguration; 421 | buildSettings = { 422 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/InteractiveTransition.app/InteractiveTransition"; 423 | FRAMEWORK_SEARCH_PATHS = ( 424 | "$(SDKROOT)/Developer/Library/Frameworks", 425 | "$(inherited)", 426 | "$(DEVELOPER_FRAMEWORKS_DIR)", 427 | ); 428 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 429 | GCC_PREFIX_HEADER = "InteractiveTransition/InteractiveTransition-Prefix.pch"; 430 | GCC_PREPROCESSOR_DEFINITIONS = ( 431 | "DEBUG=1", 432 | "$(inherited)", 433 | ); 434 | INFOPLIST_FILE = "InteractiveTransitionTests/InteractiveTransitionTests-Info.plist"; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | TEST_HOST = "$(BUNDLE_LOADER)"; 437 | WRAPPER_EXTENSION = xctest; 438 | }; 439 | name = Debug; 440 | }; 441 | 9F00112118EF025100A0AB17 /* Release */ = { 442 | isa = XCBuildConfiguration; 443 | buildSettings = { 444 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/InteractiveTransition.app/InteractiveTransition"; 445 | FRAMEWORK_SEARCH_PATHS = ( 446 | "$(SDKROOT)/Developer/Library/Frameworks", 447 | "$(inherited)", 448 | "$(DEVELOPER_FRAMEWORKS_DIR)", 449 | ); 450 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 451 | GCC_PREFIX_HEADER = "InteractiveTransition/InteractiveTransition-Prefix.pch"; 452 | INFOPLIST_FILE = "InteractiveTransitionTests/InteractiveTransitionTests-Info.plist"; 453 | PRODUCT_NAME = "$(TARGET_NAME)"; 454 | TEST_HOST = "$(BUNDLE_LOADER)"; 455 | WRAPPER_EXTENSION = xctest; 456 | }; 457 | name = Release; 458 | }; 459 | /* End XCBuildConfiguration section */ 460 | 461 | /* Begin XCConfigurationList section */ 462 | 9F0010E518EF025100A0AB17 /* Build configuration list for PBXProject "InteractiveTransition" */ = { 463 | isa = XCConfigurationList; 464 | buildConfigurations = ( 465 | 9F00111A18EF025100A0AB17 /* Debug */, 466 | 9F00111B18EF025100A0AB17 /* Release */, 467 | ); 468 | defaultConfigurationIsVisible = 0; 469 | defaultConfigurationName = Release; 470 | }; 471 | 9F00111C18EF025100A0AB17 /* Build configuration list for PBXNativeTarget "InteractiveTransition" */ = { 472 | isa = XCConfigurationList; 473 | buildConfigurations = ( 474 | 9F00111D18EF025100A0AB17 /* Debug */, 475 | 9F00111E18EF025100A0AB17 /* Release */, 476 | ); 477 | defaultConfigurationIsVisible = 0; 478 | defaultConfigurationName = Release; 479 | }; 480 | 9F00111F18EF025100A0AB17 /* Build configuration list for PBXNativeTarget "InteractiveTransitionTests" */ = { 481 | isa = XCConfigurationList; 482 | buildConfigurations = ( 483 | 9F00112018EF025100A0AB17 /* Debug */, 484 | 9F00112118EF025100A0AB17 /* Release */, 485 | ); 486 | defaultConfigurationIsVisible = 0; 487 | defaultConfigurationName = Release; 488 | }; 489 | /* End XCConfigurationList section */ 490 | }; 491 | rootObject = 9F0010E218EF025100A0AB17 /* Project object */; 492 | } 493 | -------------------------------------------------------------------------------- /InteractiveTransition.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /InteractiveTransition.xcodeproj/project.xcworkspace/xcshareddata/InteractiveTransition.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 2B1892E0-30BE-4D19-B1D6-EE53D741498D 9 | IDESourceControlProjectName 10 | InteractiveTransition 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | BADD0A9E-8394-47D1-887F-A9620F90054B 14 | https://github.com/stringcode86/UIPercentDrivenInteractiveTransitionWithCABasicAnimation.git 15 | 16 | IDESourceControlProjectPath 17 | InteractiveTransition.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | BADD0A9E-8394-47D1-887F-A9620F90054B 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/stringcode86/UIPercentDrivenInteractiveTransitionWithCABasicAnimation.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | BADD0A9E-8394-47D1-887F-A9620F90054B 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | BADD0A9E-8394-47D1-887F-A9620F90054B 36 | IDESourceControlWCCName 37 | UIPercentDrivenInteractiveTransitionWithCABasicAnimation 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /InteractiveTransition/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 | 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 | 99 | -------------------------------------------------------------------------------- /InteractiveTransition/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 | } -------------------------------------------------------------------------------- /InteractiveTransition/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 | } -------------------------------------------------------------------------------- /InteractiveTransition/InteractiveTransition-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.touchnote.iphone.${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 | -------------------------------------------------------------------------------- /InteractiveTransition/InteractiveTransition-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 | -------------------------------------------------------------------------------- /InteractiveTransition/SCAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCAppDelegate.h 3 | // InteractiveTransition 4 | // 5 | // Created by Michal Inger on 04/04/2014. 6 | // Copyright (c) 2014 StringCode Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SCAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /InteractiveTransition/SCAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCAppDelegate.m 3 | // InteractiveTransition 4 | // 5 | // Created by Michal Inger on 04/04/2014. 6 | // Copyright (c) 2014 StringCode Ltd. All rights reserved. 7 | // 8 | 9 | #import "SCAppDelegate.h" 10 | 11 | @implementation SCAppDelegate 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 | -------------------------------------------------------------------------------- /InteractiveTransition/SCDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCDetailViewController.h 3 | // InteractiveTransition 4 | // 5 | // Created by Michal Inger on 04/04/2014. 6 | // Copyright (c) 2014 StringCode Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SCDetailViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /InteractiveTransition/SCDetailViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCDetailViewController.m 3 | // InteractiveTransition 4 | // 5 | // Created by Michal Inger on 04/04/2014. 6 | // Copyright (c) 2014 StringCode Ltd. All rights reserved. 7 | // 8 | 9 | #import "SCDetailViewController.h" 10 | #import "SCTransition.h" 11 | 12 | @interface SCDetailViewController () 13 | @property (nonatomic, strong) SCTransition *transition; 14 | 15 | @end 16 | 17 | @implementation SCDetailViewController 18 | 19 | - (void)viewDidLoad 20 | { 21 | [super viewDidLoad]; 22 | self.navigationController.delegate = self; 23 | UIScreenEdgePanGestureRecognizer *pop = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)]; 24 | pop.edges = UIRectEdgeLeft; 25 | [self.view addGestureRecognizer:pop]; 26 | } 27 | 28 | #pragma mark - Navigation controller delegate 29 | 30 | - (id )navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC { 31 | return (operation == UINavigationControllerOperationPop) ? self.transition : nil; 32 | } 33 | 34 | - (id)navigationController:(UINavigationController *)navigationController interactionControllerForAnimationController:(id)animationController{ 35 | return (self.transition.shouldBeginInteractiveTransition) ? self.transition : nil; 36 | } 37 | 38 | - (void)handleGesture:(UIScreenEdgePanGestureRecognizer *)recognizer { 39 | self.transition.shouldBeginInteractiveTransition = YES; 40 | if (recognizer.state == UIGestureRecognizerStateBegan) { 41 | [self.navigationController popViewControllerAnimated:YES]; 42 | } 43 | [self.transition handleGesture:recognizer]; 44 | } 45 | 46 | - (SCTransition *)transition { 47 | if (!_transition) { 48 | _transition = [[SCTransition alloc] init]; 49 | _transition.transitionDirection = kSCTransitionBackwards; 50 | } 51 | return _transition; 52 | } 53 | 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /InteractiveTransition/SCPercentDrivenInteractiveTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCPercentDrivenInteractiveTransition.h 3 | // InteractiveTransition 4 | // 5 | // Created by Michal Inger on 05/04/2014. 6 | // Copyright (c) 2014 StringCode Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSUInteger, SCTranstionDirection) { 12 | kSCTransitionForwards, 13 | kSCTransitionBackwards, 14 | }; 15 | 16 | /** 17 | SCPercentDrivenInteractiveTransition is alternative implementation to UIPercentDrivenInteractiveTransition. 18 | SCPercentDrivenInteractiveTransition will work work both (unlike UIPercentDrivenInteractiveTransition) UIView 19 | and CoreAnimation animtions from the get go. Only methods that need to be overriden are animateTransition: 20 | and transitionDuration. Animations are going to be interpolated based on gesture passed in handleGesture: 21 | */ 22 | 23 | @interface SCPercentDrivenInteractiveTransition : NSObject 24 | 25 | /* 26 | @abstract Muss overide this method and perform your animations. 27 | @param transitionContext transitioning context passed by system 28 | @warning Muss check wether animation was caneled in completeTransition: 29 | for interactive transition to work correctly 30 | */ 31 | - (void)animateTransition:(id)transitionContext; 32 | 33 | /** 34 | @abstract Call this method with recognizer. Transition progress is calculated 35 | based on recognizers position in view. 36 | @param recognizer Idealy UIScreenEdgePanGestureRecognizer, will work with Pan 37 | and swipe as well 38 | */ 39 | - (void)handleGesture:(UIScreenEdgePanGestureRecognizer *)recognizer; 40 | 41 | /** 42 | @abstract Overide to change transition duraiton 43 | @return Transtion duration, defaults to 1.0 44 | @param transitionContext transitioning context passed by system 45 | */ 46 | - (NSTimeInterval)transitionDuration:(id)transitionContext; 47 | 48 | ///Transition direction, defaultkSCTransitionForwards 49 | @property (nonatomic) SCTranstionDirection transitionDirection; 50 | 51 | /** 52 | Optional value to keep track of wether animation should be interactive, 53 | always set to no at the UIGestureRecognizerStateEnded. Setting this 54 | property to NO will not stop intrective transition from begining. 55 | */ 56 | @property (nonatomic) BOOL shouldBeginInteractiveTransition; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /InteractiveTransition/SCPercentDrivenInteractiveTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCPercentDrivenInteractiveTransition.m 3 | // InteractiveTransition 4 | // 5 | // Created by Michal Inger on 05/04/2014. 6 | // Copyright (c) 2014 StringCode Ltd. All rights reserved. 7 | // 8 | 9 | #import "SCPercentDrivenInteractiveTransition.h" 10 | 11 | @implementation SCPercentDrivenInteractiveTransition { 12 | CGFloat _pausedTime; 13 | CGFloat _completionSpeed; 14 | __weak id _transitionContext; 15 | } 16 | 17 | - (void)animateTransition:(id)transitionContext { 18 | 19 | // Must be implemented by inheriting class 20 | [self doesNotRecognizeSelector:_cmd]; 21 | } 22 | 23 | - (NSTimeInterval)transitionDuration:(id)transitionContext { 24 | return 1.0; 25 | } 26 | 27 | - (CGFloat)completionSpeed { 28 | return _completionSpeed; 29 | } 30 | 31 | - (void)startInteractiveTransition:(id)transitionContext { 32 | _transitionContext = transitionContext; 33 | [self animateTransition:_transitionContext]; 34 | [self pauseLayer:[transitionContext containerView].layer]; 35 | } 36 | 37 | - (void)updateInteractiveTransition:(CGFloat)percentComplete { 38 | [_transitionContext updateInteractiveTransition:percentComplete]; 39 | [_transitionContext containerView].layer.timeOffset = _pausedTime + [self transitionDuration:_transitionContext]*percentComplete; 40 | } 41 | 42 | - (void)cancelInteractiveTransition { 43 | [_transitionContext cancelInteractiveTransition]; 44 | CALayer *containerLayer =[_transitionContext containerView].layer; 45 | containerLayer.speed = -1.0; 46 | containerLayer.beginTime = CACurrentMediaTime(); 47 | CGFloat delay = ((1.0-self.completionSpeed)*[self transitionDuration:_transitionContext])+0.05; 48 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 49 | containerLayer.speed = 1.0; 50 | }); 51 | } 52 | 53 | - (void)finishInteractiveTransition { 54 | [_transitionContext finishInteractiveTransition]; 55 | [self resumeLayer:[_transitionContext containerView].layer]; 56 | } 57 | 58 | - (void)handleGesture:(UIScreenEdgePanGestureRecognizer *)recognizer { 59 | CGFloat progress = [recognizer translationInView:recognizer.view].x / (recognizer.view.bounds.size.width * 1.0); 60 | progress = fabsf(progress); 61 | progress = MIN(1.0, MAX(0.0, progress)); 62 | 63 | switch (recognizer.state) { 64 | case UIGestureRecognizerStateBegan: 65 | break; 66 | case UIGestureRecognizerStateChanged: 67 | [self updateInteractiveTransition:progress]; 68 | break; 69 | case UIGestureRecognizerStateEnded:{ 70 | if (progress < 0.5){ 71 | _completionSpeed = (1.0-progress); 72 | [self cancelInteractiveTransition]; 73 | }else{ 74 | _completionSpeed = progress; 75 | [self finishInteractiveTransition]; 76 | } 77 | self.shouldBeginInteractiveTransition = NO; 78 | break; 79 | } 80 | default: 81 | break; 82 | } 83 | } 84 | 85 | - (void)pauseLayer:(CALayer*)layer { 86 | CFTimeInterval pausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil]; 87 | layer.speed = 0.0; 88 | layer.timeOffset = pausedTime; 89 | _pausedTime = pausedTime; 90 | } 91 | 92 | - (void)resumeLayer:(CALayer*)layer { 93 | CFTimeInterval pausedTime = [layer timeOffset]; 94 | layer.speed = 1.0; 95 | layer.timeOffset = 0.0; 96 | layer.beginTime = 0.0; 97 | CFTimeInterval timeSincePause = [layer convertTime:CACurrentMediaTime() fromLayer:nil] - pausedTime; 98 | layer.beginTime = timeSincePause; 99 | } 100 | 101 | @end 102 | -------------------------------------------------------------------------------- /InteractiveTransition/SCTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCTransition.h 3 | // InteractiveTransition 4 | // 5 | // Created by Michal Inger on 04/04/2014. 6 | // Copyright (c) 2014 StringCode Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SCPercentDrivenInteractiveTransition.h" 11 | 12 | @interface SCTransition : SCPercentDrivenInteractiveTransition 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /InteractiveTransition/SCTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCTransition.m 3 | // InteractiveTransition 4 | // 5 | // Created by Michal Inger on 04/04/2014. 6 | // Copyright (c) 2014 StringCode Ltd. All rights reserved. 7 | // 8 | 9 | #import "SCTransition.h" 10 | 11 | 12 | @interface SCTransition () 13 | @end 14 | 15 | @implementation SCTransition 16 | 17 | - (void)animateTransition:(id)transitionContext { 18 | 19 | UIView *containerView = [transitionContext containerView]; 20 | UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 21 | UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 22 | 23 | if (self.transitionDirection == kSCTransitionForwards) { 24 | UIView *view = [fromViewController valueForKeyPath:@"squareView"]; 25 | 26 | [containerView insertSubview:toViewController.view atIndex:0]; 27 | [self animateLayer:view.layer withCompletion:^{ 28 | 29 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 30 | }]; 31 | 32 | } else if (self.transitionDirection == kSCTransitionBackwards) { 33 | 34 | [containerView insertSubview:toViewController.view aboveSubview:fromViewController.view]; 35 | UIView *view = [toViewController valueForKeyPath:@"squareView"]; 36 | [self animateLayer:view.layer withCompletion:^{ 37 | if ([transitionContext transitionWasCancelled]) { 38 | [containerView addSubview:fromViewController.view]; 39 | fromViewController.view.alpha = 1.0; 40 | [toViewController.view removeFromSuperview]; 41 | } 42 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 43 | }]; 44 | } 45 | } 46 | 47 | - (void)animateLayer:(CALayer *)layer withCompletion:(void(^)())block { 48 | 49 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.y"]; 50 | animation.fromValue = @0.0; 51 | animation.toValue = [NSNumber numberWithFloat:M_PI]; 52 | animation.duration = [self transitionDuration:nil]; 53 | animation.fillMode = kCAFillModeBoth; 54 | animation.removedOnCompletion = YES; 55 | animation.delegate = self; 56 | [animation setValue:block forKeyPath:@"block"]; 57 | [layer addAnimation:animation forKey:@"transform.rotation.y"]; 58 | } 59 | 60 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { 61 | void(^block)() = [anim valueForKeyPath:@"block"]; 62 | if (block){ 63 | block(); 64 | } 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /InteractiveTransition/SCViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCViewController.h 3 | // InteractiveTransition 4 | // 5 | // Created by Michal Inger on 04/04/2014. 6 | // Copyright (c) 2014 StringCode Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SCViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /InteractiveTransition/SCViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCViewController.m 3 | // InteractiveTransition 4 | // 5 | // Created by Michal Inger on 04/04/2014. 6 | // Copyright (c) 2014 StringCode Ltd. All rights reserved. 7 | // 8 | 9 | #import "SCViewController.h" 10 | #import "SCTransition.h" 11 | 12 | @interface SCViewController () 13 | @property (weak, nonatomic) IBOutlet UIView *squareView; 14 | @property (nonatomic) SCTransition *transition; 15 | @end 16 | 17 | @implementation SCViewController 18 | 19 | - (void)viewDidAppear:(BOOL)animated { 20 | [super viewDidAppear:animated]; 21 | self.navigationController.delegate = self; 22 | CATransform3D transfrom = CATransform3DIdentity; 23 | transfrom.m34 = -1.f/500.f; 24 | self.view.layer.sublayerTransform = transfrom; 25 | 26 | UIScreenEdgePanGestureRecognizer *pop = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)]; 27 | pop.edges = UIRectEdgeRight; 28 | [self.view addGestureRecognizer:pop]; 29 | } 30 | 31 | - (void)animateLayer:(CALayer *)layer withCompletion:(void(^)())block { 32 | 33 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.y"]; 34 | animation.fromValue = @0.0; 35 | animation.toValue = [NSNumber numberWithFloat:M_PI]; 36 | animation.duration = 2.0; 37 | animation.fillMode = kCAFillModeBoth; 38 | animation.removedOnCompletion = NO; 39 | animation.delegate = self; 40 | [animation setValue:block forKeyPath:@"block"]; 41 | [layer addAnimation:animation forKey:@"transform.rotation.y"]; 42 | } 43 | 44 | 45 | #pragma mark - Navigation controller delegate 46 | 47 | - (id )navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC { 48 | return (operation == UINavigationControllerOperationPush) ? [[SCTransition alloc] init] : nil; 49 | } 50 | - (id)navigationController:(UINavigationController *)navigationController interactionControllerForAnimationController:(id)animationController{ 51 | return (self.transition.shouldBeginInteractiveTransition) ? self.transition : nil; 52 | } 53 | 54 | - (void)handleGesture:(UIScreenEdgePanGestureRecognizer *)recognizer { 55 | self.transition.shouldBeginInteractiveTransition = YES; 56 | if (recognizer.state == UIGestureRecognizerStateBegan) { 57 | [self performSegueWithIdentifier:@"toSecond" sender:self]; 58 | } 59 | [self.transition handleGesture:recognizer]; 60 | } 61 | 62 | - (SCTransition *)transition { 63 | if (!_transition) { 64 | _transition = [[SCTransition alloc] init]; 65 | _transition.transitionDirection = kSCTransitionForwards; 66 | } 67 | return _transition; 68 | } 69 | 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /InteractiveTransition/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /InteractiveTransition/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // InteractiveTransition 4 | // 5 | // Created by Michal Inger on 04/04/2014. 6 | // Copyright (c) 2014 StringCode Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "SCAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([SCAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /InteractiveTransitionTests/InteractiveTransitionTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.touchnote.iphone.${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 | -------------------------------------------------------------------------------- /InteractiveTransitionTests/InteractiveTransitionTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // InteractiveTransitionTests.m 3 | // InteractiveTransitionTests 4 | // 5 | // Created by Michal Inger on 04/04/2014. 6 | // Copyright (c) 2014 StringCode Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface InteractiveTransitionTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation InteractiveTransitionTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /InteractiveTransitionTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | UIPercentDrivenInteractiveTransitionWithCABasicAnimation 2 | ======================================================== 3 | 4 | This project is for demo purposes. When using gesture driven UIPercentDrivenInteractiveTransition with CABasicAnimation (or any other CAAnimation), upon finishInteractiveTransition, animation jumps to final position, rather then animating smoothly as is the case when using UIView block animation. I am trying to figure out how to animate smoothly upon finishInteractiveTransition to end when using CAAnimation. 5 | 6 | SOLUTION 7 | 8 | As it turns out solution is to manipulate layers begin time. I am going to try to explain the solution in bit more depth below. There are two solution one using UIPercentDrivenTransition subclass or implementing UIViewControllerInteractiveTransitioning protocol. Custom UIViewControllerInteractiveTransitioning is on the master branch and UIPercentDrivenTransition implementation is on UIPercentDrivenTransitionImplementation branch. 9 | 10 | https://github.com/stringcode86/UIPercentDrivenInteractiveTransitionWithCABasicAnimation 11 | 12 | EXPLANATION 13 | 14 | UIPercentDrivenTransition uses animations in animateTransition: to implement updateInteractiveTransition: . I am guessing they simply call animateTransition: from startInteractiveTransition: and then set layer (perhaps containers view layer) speed to 0.0 and manipulate its timeOffSet. This allow them to automatically move your transition back and forward. This does it for your UIView animations. Problem with CAAnimations is their begingTime, timeOffSet, speed properties are not set correctly for some reason. If you set those to sensible values, you are able to move all animated content in containerView back and forth. I have created SCPercentDrivenTransition witch is alternative to UIPercentDrivenTransition. You only need to override animateTransition: and call handleGesture: from your gesture recognisers action calls. 15 | 16 | --------------------------------------------------------------------------------