├── LICENSE ├── README.md ├── RadialTransitionExample ├── RadialTransitionExample.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── RadialTransitionExample.xccheckout │ │ └── xcuserdata │ │ │ └── alexpadalko.xcuserdatad │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ └── WorkspaceSettings.xcsettings │ └── xcuserdata │ │ └── alexpadalko.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── RadialTransitionExample.xcscheme │ │ └── xcschememanagement.plist ├── RadialTransitionExample │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── FirstViewController.h │ ├── FirstViewController.m │ ├── FirstViewController.xib │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── SecondViewController.h │ ├── SecondViewController.m │ ├── SecondViewController.xib │ ├── Yoda-Art-Wallpaper.jpg │ ├── main.m │ └── star-wars_00409801.jpg └── RadialTransitionExampleTests │ ├── Info.plist │ └── RadialTransitionExampleTests.m ├── RadialTransitionSource ├── AAPTransitionDirector.h ├── AAPTransitionDirector.m ├── UINavigationController+RadialTransaction.h ├── UINavigationController+RadialTransaction.m ├── UIView+Radial.h └── UIView+Radial.m ├── radialDemo_short.gif └── radilaDemo_long.gif /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Alex Padalko 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | RadialTransition_objC 2 | ===================== 3 | 4 | Great ios radial transition for navigation controller, with custom back swipe. 5 | 6 | 7 | Demo 8 | ---- 9 | ![alt tag](https://raw.githubusercontent.com/apadalko/RadialTransition_objC/master/radilaDemo_long.gif) 10 | 11 | 12 | Usage 13 | ---- 14 | just import 15 | ``` objc 16 | #import "UINavigationController+RadialTransaction.h" 17 | ``` 18 | for push simple use 19 | ``` objc 20 | [self.navigationController radialPushViewController:[[UIViewController alloc]init] comlititionBlock:^{ 21 | 22 | }]; 23 | //or 24 | [self.navigationController radialPushViewController:[[UIViewController alloc]init] withDuration:1 comlititionBlock:^{ 25 | 26 | }]; 27 | //or 28 | [self.navigationController radialPushViewController:[[UIViewController alloc]init] withDuration:1 withStartFrame:CGRectMake(self.view.frame.size.width, 0, 0, 0) comlititionBlock:^{ 29 | 30 | }]; 31 | ``` 32 | for pop use 33 | ``` objc 34 | [self.navigationController radialPopViewControllerWithComlititionBlock:^{ 35 | 36 | }]; 37 | //or 38 | [self.navigationController radialPopViewControllerWithDuration:0.9 comlititionBlock:^{ 39 | 40 | }]; 41 | //or 42 | [self.navigationController radialPopViewControllerWithDuration:0.9 withStartFrame:CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height, 0, 0) comlititionBlock:^{ 43 | 44 | }]; 45 | ``` 46 | to enable swipe to back just use 47 | ``` objc 48 | [self.navigationController enableRadialSwipe]; 49 | ``` 50 | to disable 51 | ``` objc 52 | [self.navigationController disableRadialSwipe]; 53 | ``` 54 | if you want to change back swipe speed you may set new default duration 55 | ``` objc 56 | [UINavigationController setDefaultRadialAnimationTime:11]; 57 | ``` 58 | Requirements 59 | --- 60 | ios 7 +,xcode 5+ 61 | 62 | Futher Work 63 | --- 64 | -add TabbarController transaction 65 | -add radial circle options (shadow,color etc) 66 | -other improvements 67 | 68 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B8B7C7D119D385B900EA3D24 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B8B7C7D019D385B900EA3D24 /* main.m */; }; 11 | B8B7C7D419D385B900EA3D24 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B8B7C7D319D385B900EA3D24 /* AppDelegate.m */; }; 12 | B8B7C7DC19D385B900EA3D24 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B8B7C7DB19D385B900EA3D24 /* Images.xcassets */; }; 13 | B8B7C7DF19D385BA00EA3D24 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = B8B7C7DD19D385BA00EA3D24 /* LaunchScreen.xib */; }; 14 | B8B7C7EB19D385BA00EA3D24 /* RadialTransitionExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B8B7C7EA19D385BA00EA3D24 /* RadialTransitionExampleTests.m */; }; 15 | B8B7C7FB19D385C400EA3D24 /* AAPTransitionDirector.m in Sources */ = {isa = PBXBuildFile; fileRef = B8B7C7F619D385C400EA3D24 /* AAPTransitionDirector.m */; }; 16 | B8B7C7FC19D385C400EA3D24 /* UINavigationController+RadialTransaction.m in Sources */ = {isa = PBXBuildFile; fileRef = B8B7C7F819D385C400EA3D24 /* UINavigationController+RadialTransaction.m */; }; 17 | B8B7C7FD19D385C400EA3D24 /* UIView+Radial.m in Sources */ = {isa = PBXBuildFile; fileRef = B8B7C7FA19D385C400EA3D24 /* UIView+Radial.m */; }; 18 | B8B7C80019D3860E00EA3D24 /* FirstViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B8B7C7FF19D3860E00EA3D24 /* FirstViewController.m */; }; 19 | B8B7C80219D3865B00EA3D24 /* FirstViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B8B7C80119D3865B00EA3D24 /* FirstViewController.xib */; }; 20 | B8B7C80619D3871800EA3D24 /* SecondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B8B7C80419D3871800EA3D24 /* SecondViewController.m */; }; 21 | B8B7C80719D3871800EA3D24 /* SecondViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B8B7C80519D3871800EA3D24 /* SecondViewController.xib */; }; 22 | B8B7C80919D38B8A00EA3D24 /* Yoda-Art-Wallpaper.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B8B7C80819D38B8A00EA3D24 /* Yoda-Art-Wallpaper.jpg */; }; 23 | B8B7C80E19D3914C00EA3D24 /* star-wars_00409801.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B8B7C80D19D3914C00EA3D24 /* star-wars_00409801.jpg */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | B8B7C7E519D385BA00EA3D24 /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = B8B7C7C319D385B900EA3D24 /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = B8B7C7CA19D385B900EA3D24; 32 | remoteInfo = RadialTransitionExample; 33 | }; 34 | /* End PBXContainerItemProxy section */ 35 | 36 | /* Begin PBXFileReference section */ 37 | B8B7C7CB19D385B900EA3D24 /* RadialTransitionExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RadialTransitionExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | B8B7C7CF19D385B900EA3D24 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | B8B7C7D019D385B900EA3D24 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 40 | B8B7C7D219D385B900EA3D24 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 41 | B8B7C7D319D385B900EA3D24 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 42 | B8B7C7DB19D385B900EA3D24 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 43 | B8B7C7DE19D385BA00EA3D24 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 44 | B8B7C7E419D385BA00EA3D24 /* RadialTransitionExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RadialTransitionExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | B8B7C7E919D385BA00EA3D24 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | B8B7C7EA19D385BA00EA3D24 /* RadialTransitionExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RadialTransitionExampleTests.m; sourceTree = ""; }; 47 | B8B7C7F519D385C400EA3D24 /* AAPTransitionDirector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAPTransitionDirector.h; sourceTree = ""; }; 48 | B8B7C7F619D385C400EA3D24 /* AAPTransitionDirector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AAPTransitionDirector.m; sourceTree = ""; }; 49 | B8B7C7F719D385C400EA3D24 /* UINavigationController+RadialTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UINavigationController+RadialTransaction.h"; sourceTree = ""; }; 50 | B8B7C7F819D385C400EA3D24 /* UINavigationController+RadialTransaction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINavigationController+RadialTransaction.m"; sourceTree = ""; }; 51 | B8B7C7F919D385C400EA3D24 /* UIView+Radial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Radial.h"; sourceTree = ""; }; 52 | B8B7C7FA19D385C400EA3D24 /* UIView+Radial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Radial.m"; sourceTree = ""; }; 53 | B8B7C7FE19D3860D00EA3D24 /* FirstViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FirstViewController.h; sourceTree = ""; }; 54 | B8B7C7FF19D3860E00EA3D24 /* FirstViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FirstViewController.m; sourceTree = ""; }; 55 | B8B7C80119D3865B00EA3D24 /* FirstViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FirstViewController.xib; sourceTree = ""; }; 56 | B8B7C80319D3871800EA3D24 /* SecondViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecondViewController.h; sourceTree = ""; }; 57 | B8B7C80419D3871800EA3D24 /* SecondViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecondViewController.m; sourceTree = ""; }; 58 | B8B7C80519D3871800EA3D24 /* SecondViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SecondViewController.xib; sourceTree = ""; }; 59 | B8B7C80819D38B8A00EA3D24 /* Yoda-Art-Wallpaper.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "Yoda-Art-Wallpaper.jpg"; sourceTree = ""; }; 60 | B8B7C80D19D3914C00EA3D24 /* star-wars_00409801.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "star-wars_00409801.jpg"; sourceTree = ""; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | B8B7C7C819D385B900EA3D24 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | B8B7C7E119D385BA00EA3D24 /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | /* End PBXFrameworksBuildPhase section */ 79 | 80 | /* Begin PBXGroup section */ 81 | B8B7C7C219D385B900EA3D24 = { 82 | isa = PBXGroup; 83 | children = ( 84 | B8B7C7CD19D385B900EA3D24 /* RadialTransitionExample */, 85 | B8B7C7E719D385BA00EA3D24 /* RadialTransitionExampleTests */, 86 | B8B7C7CC19D385B900EA3D24 /* Products */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | B8B7C7CC19D385B900EA3D24 /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | B8B7C7CB19D385B900EA3D24 /* RadialTransitionExample.app */, 94 | B8B7C7E419D385BA00EA3D24 /* RadialTransitionExampleTests.xctest */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | B8B7C7CD19D385B900EA3D24 /* RadialTransitionExample */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | B8B7C80A19D38B9200EA3D24 /* resources */, 103 | B8B7C7F419D385C400EA3D24 /* RadialTransitionSource */, 104 | B8B7C7D219D385B900EA3D24 /* AppDelegate.h */, 105 | B8B7C7D319D385B900EA3D24 /* AppDelegate.m */, 106 | B8B7C80F19D3919200EA3D24 /* pages */, 107 | B8B7C7DB19D385B900EA3D24 /* Images.xcassets */, 108 | B8B7C7DD19D385BA00EA3D24 /* LaunchScreen.xib */, 109 | B8B7C7CE19D385B900EA3D24 /* Supporting Files */, 110 | ); 111 | path = RadialTransitionExample; 112 | sourceTree = ""; 113 | }; 114 | B8B7C7CE19D385B900EA3D24 /* Supporting Files */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | B8B7C7CF19D385B900EA3D24 /* Info.plist */, 118 | B8B7C7D019D385B900EA3D24 /* main.m */, 119 | ); 120 | name = "Supporting Files"; 121 | sourceTree = ""; 122 | }; 123 | B8B7C7E719D385BA00EA3D24 /* RadialTransitionExampleTests */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | B8B7C7EA19D385BA00EA3D24 /* RadialTransitionExampleTests.m */, 127 | B8B7C7E819D385BA00EA3D24 /* Supporting Files */, 128 | ); 129 | path = RadialTransitionExampleTests; 130 | sourceTree = ""; 131 | }; 132 | B8B7C7E819D385BA00EA3D24 /* Supporting Files */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | B8B7C7E919D385BA00EA3D24 /* Info.plist */, 136 | ); 137 | name = "Supporting Files"; 138 | sourceTree = ""; 139 | }; 140 | B8B7C7F419D385C400EA3D24 /* RadialTransitionSource */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | B8B7C7F519D385C400EA3D24 /* AAPTransitionDirector.h */, 144 | B8B7C7F619D385C400EA3D24 /* AAPTransitionDirector.m */, 145 | B8B7C7F719D385C400EA3D24 /* UINavigationController+RadialTransaction.h */, 146 | B8B7C7F819D385C400EA3D24 /* UINavigationController+RadialTransaction.m */, 147 | B8B7C7F919D385C400EA3D24 /* UIView+Radial.h */, 148 | B8B7C7FA19D385C400EA3D24 /* UIView+Radial.m */, 149 | ); 150 | name = RadialTransitionSource; 151 | path = ../../RadialTransitionSource; 152 | sourceTree = ""; 153 | }; 154 | B8B7C80A19D38B9200EA3D24 /* resources */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | B8B7C80819D38B8A00EA3D24 /* Yoda-Art-Wallpaper.jpg */, 158 | B8B7C80D19D3914C00EA3D24 /* star-wars_00409801.jpg */, 159 | ); 160 | name = resources; 161 | sourceTree = ""; 162 | }; 163 | B8B7C80F19D3919200EA3D24 /* pages */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | B8B7C7FE19D3860D00EA3D24 /* FirstViewController.h */, 167 | B8B7C7FF19D3860E00EA3D24 /* FirstViewController.m */, 168 | B8B7C80119D3865B00EA3D24 /* FirstViewController.xib */, 169 | B8B7C80319D3871800EA3D24 /* SecondViewController.h */, 170 | B8B7C80419D3871800EA3D24 /* SecondViewController.m */, 171 | B8B7C80519D3871800EA3D24 /* SecondViewController.xib */, 172 | ); 173 | name = pages; 174 | sourceTree = ""; 175 | }; 176 | /* End PBXGroup section */ 177 | 178 | /* Begin PBXNativeTarget section */ 179 | B8B7C7CA19D385B900EA3D24 /* RadialTransitionExample */ = { 180 | isa = PBXNativeTarget; 181 | buildConfigurationList = B8B7C7EE19D385BA00EA3D24 /* Build configuration list for PBXNativeTarget "RadialTransitionExample" */; 182 | buildPhases = ( 183 | B8B7C7C719D385B900EA3D24 /* Sources */, 184 | B8B7C7C819D385B900EA3D24 /* Frameworks */, 185 | B8B7C7C919D385B900EA3D24 /* Resources */, 186 | ); 187 | buildRules = ( 188 | ); 189 | dependencies = ( 190 | ); 191 | name = RadialTransitionExample; 192 | productName = RadialTransitionExample; 193 | productReference = B8B7C7CB19D385B900EA3D24 /* RadialTransitionExample.app */; 194 | productType = "com.apple.product-type.application"; 195 | }; 196 | B8B7C7E319D385BA00EA3D24 /* RadialTransitionExampleTests */ = { 197 | isa = PBXNativeTarget; 198 | buildConfigurationList = B8B7C7F119D385BA00EA3D24 /* Build configuration list for PBXNativeTarget "RadialTransitionExampleTests" */; 199 | buildPhases = ( 200 | B8B7C7E019D385BA00EA3D24 /* Sources */, 201 | B8B7C7E119D385BA00EA3D24 /* Frameworks */, 202 | B8B7C7E219D385BA00EA3D24 /* Resources */, 203 | ); 204 | buildRules = ( 205 | ); 206 | dependencies = ( 207 | B8B7C7E619D385BA00EA3D24 /* PBXTargetDependency */, 208 | ); 209 | name = RadialTransitionExampleTests; 210 | productName = RadialTransitionExampleTests; 211 | productReference = B8B7C7E419D385BA00EA3D24 /* RadialTransitionExampleTests.xctest */; 212 | productType = "com.apple.product-type.bundle.unit-test"; 213 | }; 214 | /* End PBXNativeTarget section */ 215 | 216 | /* Begin PBXProject section */ 217 | B8B7C7C319D385B900EA3D24 /* Project object */ = { 218 | isa = PBXProject; 219 | attributes = { 220 | LastUpgradeCheck = 0600; 221 | ORGANIZATIONNAME = "Alex Padalko"; 222 | TargetAttributes = { 223 | B8B7C7CA19D385B900EA3D24 = { 224 | CreatedOnToolsVersion = 6.0.1; 225 | }; 226 | B8B7C7E319D385BA00EA3D24 = { 227 | CreatedOnToolsVersion = 6.0.1; 228 | TestTargetID = B8B7C7CA19D385B900EA3D24; 229 | }; 230 | }; 231 | }; 232 | buildConfigurationList = B8B7C7C619D385B900EA3D24 /* Build configuration list for PBXProject "RadialTransitionExample" */; 233 | compatibilityVersion = "Xcode 3.2"; 234 | developmentRegion = English; 235 | hasScannedForEncodings = 0; 236 | knownRegions = ( 237 | en, 238 | Base, 239 | ); 240 | mainGroup = B8B7C7C219D385B900EA3D24; 241 | productRefGroup = B8B7C7CC19D385B900EA3D24 /* Products */; 242 | projectDirPath = ""; 243 | projectRoot = ""; 244 | targets = ( 245 | B8B7C7CA19D385B900EA3D24 /* RadialTransitionExample */, 246 | B8B7C7E319D385BA00EA3D24 /* RadialTransitionExampleTests */, 247 | ); 248 | }; 249 | /* End PBXProject section */ 250 | 251 | /* Begin PBXResourcesBuildPhase section */ 252 | B8B7C7C919D385B900EA3D24 /* Resources */ = { 253 | isa = PBXResourcesBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | B8B7C7DF19D385BA00EA3D24 /* LaunchScreen.xib in Resources */, 257 | B8B7C7DC19D385B900EA3D24 /* Images.xcassets in Resources */, 258 | B8B7C80919D38B8A00EA3D24 /* Yoda-Art-Wallpaper.jpg in Resources */, 259 | B8B7C80219D3865B00EA3D24 /* FirstViewController.xib in Resources */, 260 | B8B7C80E19D3914C00EA3D24 /* star-wars_00409801.jpg in Resources */, 261 | B8B7C80719D3871800EA3D24 /* SecondViewController.xib in Resources */, 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | B8B7C7E219D385BA00EA3D24 /* Resources */ = { 266 | isa = PBXResourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | }; 272 | /* End PBXResourcesBuildPhase section */ 273 | 274 | /* Begin PBXSourcesBuildPhase section */ 275 | B8B7C7C719D385B900EA3D24 /* Sources */ = { 276 | isa = PBXSourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | B8B7C7FC19D385C400EA3D24 /* UINavigationController+RadialTransaction.m in Sources */, 280 | B8B7C80019D3860E00EA3D24 /* FirstViewController.m in Sources */, 281 | B8B7C7D419D385B900EA3D24 /* AppDelegate.m in Sources */, 282 | B8B7C80619D3871800EA3D24 /* SecondViewController.m in Sources */, 283 | B8B7C7D119D385B900EA3D24 /* main.m in Sources */, 284 | B8B7C7FB19D385C400EA3D24 /* AAPTransitionDirector.m in Sources */, 285 | B8B7C7FD19D385C400EA3D24 /* UIView+Radial.m in Sources */, 286 | ); 287 | runOnlyForDeploymentPostprocessing = 0; 288 | }; 289 | B8B7C7E019D385BA00EA3D24 /* Sources */ = { 290 | isa = PBXSourcesBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | B8B7C7EB19D385BA00EA3D24 /* RadialTransitionExampleTests.m in Sources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | /* End PBXSourcesBuildPhase section */ 298 | 299 | /* Begin PBXTargetDependency section */ 300 | B8B7C7E619D385BA00EA3D24 /* PBXTargetDependency */ = { 301 | isa = PBXTargetDependency; 302 | target = B8B7C7CA19D385B900EA3D24 /* RadialTransitionExample */; 303 | targetProxy = B8B7C7E519D385BA00EA3D24 /* PBXContainerItemProxy */; 304 | }; 305 | /* End PBXTargetDependency section */ 306 | 307 | /* Begin PBXVariantGroup section */ 308 | B8B7C7DD19D385BA00EA3D24 /* LaunchScreen.xib */ = { 309 | isa = PBXVariantGroup; 310 | children = ( 311 | B8B7C7DE19D385BA00EA3D24 /* Base */, 312 | ); 313 | name = LaunchScreen.xib; 314 | sourceTree = ""; 315 | }; 316 | /* End PBXVariantGroup section */ 317 | 318 | /* Begin XCBuildConfiguration section */ 319 | B8B7C7EC19D385BA00EA3D24 /* Debug */ = { 320 | isa = XCBuildConfiguration; 321 | buildSettings = { 322 | ALWAYS_SEARCH_USER_PATHS = NO; 323 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 324 | CLANG_CXX_LIBRARY = "libc++"; 325 | CLANG_ENABLE_MODULES = YES; 326 | CLANG_ENABLE_OBJC_ARC = YES; 327 | CLANG_WARN_BOOL_CONVERSION = YES; 328 | CLANG_WARN_CONSTANT_CONVERSION = YES; 329 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 330 | CLANG_WARN_EMPTY_BODY = YES; 331 | CLANG_WARN_ENUM_CONVERSION = YES; 332 | CLANG_WARN_INT_CONVERSION = YES; 333 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 334 | CLANG_WARN_UNREACHABLE_CODE = YES; 335 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 336 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 337 | COPY_PHASE_STRIP = NO; 338 | ENABLE_STRICT_OBJC_MSGSEND = YES; 339 | GCC_C_LANGUAGE_STANDARD = gnu99; 340 | GCC_DYNAMIC_NO_PIC = NO; 341 | GCC_OPTIMIZATION_LEVEL = 0; 342 | GCC_PREPROCESSOR_DEFINITIONS = ( 343 | "DEBUG=1", 344 | "$(inherited)", 345 | ); 346 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 347 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 348 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 349 | GCC_WARN_UNDECLARED_SELECTOR = YES; 350 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 351 | GCC_WARN_UNUSED_FUNCTION = YES; 352 | GCC_WARN_UNUSED_VARIABLE = YES; 353 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 354 | MTL_ENABLE_DEBUG_INFO = YES; 355 | ONLY_ACTIVE_ARCH = YES; 356 | SDKROOT = iphoneos; 357 | }; 358 | name = Debug; 359 | }; 360 | B8B7C7ED19D385BA00EA3D24 /* Release */ = { 361 | isa = XCBuildConfiguration; 362 | buildSettings = { 363 | ALWAYS_SEARCH_USER_PATHS = NO; 364 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 365 | CLANG_CXX_LIBRARY = "libc++"; 366 | CLANG_ENABLE_MODULES = YES; 367 | CLANG_ENABLE_OBJC_ARC = YES; 368 | CLANG_WARN_BOOL_CONVERSION = YES; 369 | CLANG_WARN_CONSTANT_CONVERSION = YES; 370 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 371 | CLANG_WARN_EMPTY_BODY = YES; 372 | CLANG_WARN_ENUM_CONVERSION = YES; 373 | CLANG_WARN_INT_CONVERSION = YES; 374 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 375 | CLANG_WARN_UNREACHABLE_CODE = YES; 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 | ENABLE_STRICT_OBJC_MSGSEND = YES; 381 | GCC_C_LANGUAGE_STANDARD = gnu99; 382 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 383 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 384 | GCC_WARN_UNDECLARED_SELECTOR = YES; 385 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 386 | GCC_WARN_UNUSED_FUNCTION = YES; 387 | GCC_WARN_UNUSED_VARIABLE = YES; 388 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 389 | MTL_ENABLE_DEBUG_INFO = NO; 390 | SDKROOT = iphoneos; 391 | VALIDATE_PRODUCT = YES; 392 | }; 393 | name = Release; 394 | }; 395 | B8B7C7EF19D385BA00EA3D24 /* Debug */ = { 396 | isa = XCBuildConfiguration; 397 | buildSettings = { 398 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 399 | INFOPLIST_FILE = RadialTransitionExample/Info.plist; 400 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 401 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 402 | PRODUCT_NAME = "$(TARGET_NAME)"; 403 | }; 404 | name = Debug; 405 | }; 406 | B8B7C7F019D385BA00EA3D24 /* Release */ = { 407 | isa = XCBuildConfiguration; 408 | buildSettings = { 409 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 410 | INFOPLIST_FILE = RadialTransitionExample/Info.plist; 411 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 412 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 413 | PRODUCT_NAME = "$(TARGET_NAME)"; 414 | }; 415 | name = Release; 416 | }; 417 | B8B7C7F219D385BA00EA3D24 /* Debug */ = { 418 | isa = XCBuildConfiguration; 419 | buildSettings = { 420 | BUNDLE_LOADER = "$(TEST_HOST)"; 421 | FRAMEWORK_SEARCH_PATHS = ( 422 | "$(SDKROOT)/Developer/Library/Frameworks", 423 | "$(inherited)", 424 | ); 425 | GCC_PREPROCESSOR_DEFINITIONS = ( 426 | "DEBUG=1", 427 | "$(inherited)", 428 | ); 429 | INFOPLIST_FILE = RadialTransitionExampleTests/Info.plist; 430 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 431 | PRODUCT_NAME = "$(TARGET_NAME)"; 432 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RadialTransitionExample.app/RadialTransitionExample"; 433 | }; 434 | name = Debug; 435 | }; 436 | B8B7C7F319D385BA00EA3D24 /* Release */ = { 437 | isa = XCBuildConfiguration; 438 | buildSettings = { 439 | BUNDLE_LOADER = "$(TEST_HOST)"; 440 | FRAMEWORK_SEARCH_PATHS = ( 441 | "$(SDKROOT)/Developer/Library/Frameworks", 442 | "$(inherited)", 443 | ); 444 | INFOPLIST_FILE = RadialTransitionExampleTests/Info.plist; 445 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 446 | PRODUCT_NAME = "$(TARGET_NAME)"; 447 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RadialTransitionExample.app/RadialTransitionExample"; 448 | }; 449 | name = Release; 450 | }; 451 | /* End XCBuildConfiguration section */ 452 | 453 | /* Begin XCConfigurationList section */ 454 | B8B7C7C619D385B900EA3D24 /* Build configuration list for PBXProject "RadialTransitionExample" */ = { 455 | isa = XCConfigurationList; 456 | buildConfigurations = ( 457 | B8B7C7EC19D385BA00EA3D24 /* Debug */, 458 | B8B7C7ED19D385BA00EA3D24 /* Release */, 459 | ); 460 | defaultConfigurationIsVisible = 0; 461 | defaultConfigurationName = Release; 462 | }; 463 | B8B7C7EE19D385BA00EA3D24 /* Build configuration list for PBXNativeTarget "RadialTransitionExample" */ = { 464 | isa = XCConfigurationList; 465 | buildConfigurations = ( 466 | B8B7C7EF19D385BA00EA3D24 /* Debug */, 467 | B8B7C7F019D385BA00EA3D24 /* Release */, 468 | ); 469 | defaultConfigurationIsVisible = 0; 470 | }; 471 | B8B7C7F119D385BA00EA3D24 /* Build configuration list for PBXNativeTarget "RadialTransitionExampleTests" */ = { 472 | isa = XCConfigurationList; 473 | buildConfigurations = ( 474 | B8B7C7F219D385BA00EA3D24 /* Debug */, 475 | B8B7C7F319D385BA00EA3D24 /* Release */, 476 | ); 477 | defaultConfigurationIsVisible = 0; 478 | }; 479 | /* End XCConfigurationList section */ 480 | }; 481 | rootObject = B8B7C7C319D385B900EA3D24 /* Project object */; 482 | } 483 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample.xcodeproj/project.xcworkspace/xcshareddata/RadialTransitionExample.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | D60B3FBC-6BC4-4757-9632-CF870E44E902 9 | IDESourceControlProjectName 10 | RadialTransitionExample 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 1274961AB3F98179C334AB6991F9536B7FFD9936 14 | https://github.com/apadalko/RadialTransition_objC.git 15 | 16 | IDESourceControlProjectPath 17 | RadialTransitionExample/RadialTransitionExample.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 1274961AB3F98179C334AB6991F9536B7FFD9936 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/apadalko/RadialTransition_objC.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 1274961AB3F98179C334AB6991F9536B7FFD9936 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 1274961AB3F98179C334AB6991F9536B7FFD9936 36 | IDESourceControlWCCName 37 | RadialTransition_objC 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample.xcodeproj/project.xcworkspace/xcuserdata/alexpadalko.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apadalko/RadialTransition_objC/48944bd4002fc59112cb1749c3179339bd9c3cf1/RadialTransitionExample/RadialTransitionExample.xcodeproj/project.xcworkspace/xcuserdata/alexpadalko.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample.xcodeproj/project.xcworkspace/xcuserdata/alexpadalko.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample.xcodeproj/xcuserdata/alexpadalko.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample.xcodeproj/xcuserdata/alexpadalko.xcuserdatad/xcschemes/RadialTransitionExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample.xcodeproj/xcuserdata/alexpadalko.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | RadialTransitionExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | B8B7C7CA19D385B900EA3D24 16 | 17 | primary 18 | 19 | 20 | B8B7C7E319D385BA00EA3D24 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // RadialTransitionExample 4 | // 5 | // Created by Alex Padalko on 9/24/14. 6 | // Copyright (c) 2014 Alex Padalko. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // RadialTransitionExample 4 | // 5 | // Created by Alex Padalko on 9/24/14. 6 | // Copyright (c) 2014 Alex Padalko. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "FirstViewController.h" 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 20 | 21 | UINavigationController * contr= [[UINavigationController alloc] initWithRootViewController:[[FirstViewController alloc] init]]; 22 | 23 | 24 | self.window.rootViewController = contr; 25 | [self.window makeKeyAndVisible]; 26 | return YES; 27 | } 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application { 30 | // 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. 31 | // 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. 32 | } 33 | 34 | - (void)applicationDidEnterBackground:(UIApplication *)application { 35 | // 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. 36 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 37 | } 38 | 39 | - (void)applicationWillEnterForeground:(UIApplication *)application { 40 | // 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. 41 | } 42 | 43 | - (void)applicationDidBecomeActive:(UIApplication *)application { 44 | // 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. 45 | } 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application { 48 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample/FirstViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.h 3 | // RadialTransitionExample 4 | // 5 | // Created by Alex Padalko on 9/24/14. 6 | // Copyright (c) 2014 Alex Padalko. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FirstViewController : UIViewController 12 | - (IBAction)simplePush:(id)sender; 13 | 14 | - (IBAction)pushWIthCustomFrame1:(id)sender; 15 | - (IBAction)pushWithCustomFrame2:(id)sender; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample/FirstViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.m 3 | // RadialTransitionExample 4 | // 5 | // Created by Alex Padalko on 9/24/14. 6 | // Copyright (c) 2014 Alex Padalko. All rights reserved. 7 | // 8 | 9 | #import "FirstViewController.h" 10 | #import "SecondViewController.h" 11 | #import "UINavigationController+RadialTransaction.h" 12 | @interface FirstViewController () 13 | 14 | @end 15 | 16 | @implementation FirstViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | [self.navigationController enableRadialSwipe]; 22 | 23 | self.title = @"First ViewController"; 24 | 25 | 26 | 27 | 28 | } 29 | 30 | - (void)didReceiveMemoryWarning { 31 | [super didReceiveMemoryWarning]; 32 | // Dispose of any resources that can be recreated. 33 | } 34 | 35 | /* 36 | #pragma mark - Navigation 37 | 38 | // In a storyboard-based application, you will often want to do a little preparation before navigation 39 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 40 | // Get the new view controller using [segue destinationViewController]. 41 | // Pass the selected object to the new view controller. 42 | } 43 | */ 44 | -(UIViewController*)secondVC{ 45 | 46 | return [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil]; 47 | 48 | } 49 | - (IBAction)simplePush:(id)sender { 50 | 51 | [self.navigationController radialPushViewController:[self secondVC] comlititionBlock:^{ 52 | 53 | }]; 54 | 55 | } 56 | 57 | - (IBAction)pushWIthCustomFrame1:(UIButton*)sender { 58 | 59 | 60 | 61 | [self.navigationController radialPushViewController:[self secondVC] withDuration:1 withStartFrame:sender.frame comlititionBlock:^{ 62 | 63 | }]; 64 | 65 | } 66 | 67 | - (IBAction)pushWithCustomFrame2:(id)sender { 68 | 69 | [self.navigationController radialPushViewController:[self secondVC] withDuration:1 withStartFrame:CGRectMake(self.view.frame.size.width, 0, 0, 0) comlititionBlock:^{ 70 | 71 | }]; 72 | 73 | } 74 | @end 75 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample/FirstViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 38 | 56 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.vv.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample/SecondViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.h 3 | // RadialTransitionExample 4 | // 5 | // Created by Alex Padalko on 9/24/14. 6 | // Copyright (c) 2014 Alex Padalko. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SecondViewController : UIViewController 12 | - (IBAction)simplePop:(id)sender; 13 | - (IBAction)customFrame1:(id)sender; 14 | - (IBAction)customFrame2:(id)sender; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample/SecondViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.m 3 | // RadialTransitionExample 4 | // 5 | // Created by Alex Padalko on 9/24/14. 6 | // Copyright (c) 2014 Alex Padalko. All rights reserved. 7 | // 8 | 9 | #import "SecondViewController.h" 10 | #import "UINavigationController+RadialTransaction.h" 11 | @interface SecondViewController () 12 | 13 | @end 14 | 15 | @implementation SecondViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | self.title = @"Second ViewController"; 21 | self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"back" style:UIBarButtonItemStylePlain target:self action:@selector(simplePop:)]; 22 | // Do any additional setup after loading the view from its nib. 23 | } 24 | 25 | - (void)didReceiveMemoryWarning { 26 | [super didReceiveMemoryWarning]; 27 | 28 | 29 | 30 | // Dispose of any resources that can be recreated. 31 | } 32 | 33 | /* 34 | #pragma mark - Navigation 35 | 36 | // In a storyboard-based application, you will often want to do a little preparation before navigation 37 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 38 | // Get the new view controller using [segue destinationViewController]. 39 | // Pass the selected object to the new view controller. 40 | } 41 | */ 42 | 43 | - (IBAction)simplePop:(id)sender { 44 | 45 | [self.navigationController radialPopViewControllerWithComlititionBlock:^{ 46 | 47 | }]; 48 | } 49 | 50 | - (IBAction)customFrame1:(id)sender { 51 | 52 | [self.navigationController radialPopViewControllerWithDuration:0.9 withStartFrame:CGRectZero comlititionBlock:^{ 53 | 54 | }]; 55 | 56 | } 57 | 58 | - (IBAction)customFrame2:(id)sender { 59 | 60 | [self.navigationController radialPopViewControllerWithDuration:0.9 withStartFrame:CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height, 0, 0) comlititionBlock:^{ 61 | 62 | }]; 63 | 64 | 65 | } 66 | @end 67 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample/SecondViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 38 | 56 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample/Yoda-Art-Wallpaper.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apadalko/RadialTransition_objC/48944bd4002fc59112cb1749c3179339bd9c3cf1/RadialTransitionExample/RadialTransitionExample/Yoda-Art-Wallpaper.jpg -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // RadialTransitionExample 4 | // 5 | // Created by Alex Padalko on 9/24/14. 6 | // Copyright (c) 2014 Alex Padalko. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExample/star-wars_00409801.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apadalko/RadialTransition_objC/48944bd4002fc59112cb1749c3179339bd9c3cf1/RadialTransitionExample/RadialTransitionExample/star-wars_00409801.jpg -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.vv.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /RadialTransitionExample/RadialTransitionExampleTests/RadialTransitionExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // RadialTransitionExampleTests.m 3 | // RadialTransitionExampleTests 4 | // 5 | // Created by Alex Padalko on 9/24/14. 6 | // Copyright (c) 2014 Alex Padalko. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface RadialTransitionExampleTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation RadialTransitionExampleTests 17 | 18 | - (void)setUp { 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 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /RadialTransitionSource/AAPTransitionDirector.h: -------------------------------------------------------------------------------- 1 | // 2 | // AnimationDirector.h 3 | // RadialTransaction 4 | // 5 | // Created by Alex Padalko on 9/22/14. 6 | // Copyright (c) 2014 Alex Padalko. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | 13 | 14 | typedef void(^UpdateBlock)(id transitionContext,float precent); 15 | typedef void(^AnimationBlock)(id transitionContext,float time,void (^complitBlock)()); 16 | 17 | 18 | @interface AAPTransitionDirector : NSObject 19 | 20 | 21 | 22 | /** 23 | * animation block.Use transactionContext to get all needed views. toViewController will be above. NOTE: if you use it for animation without interactive YOU MUST RUN complitBlock at end. 24 | * 25 | */ 26 | @property (copy)AnimationBlock animBlock; 27 | 28 | /** 29 | * interactive update block.Use transactionContext to get all needed views.updating after percent changing 30 | * 31 | */ 32 | @property (copy)UpdateBlock interactiveUpdateBlock; 33 | 34 | @property (copy)void (^interactiveComplitionBlock)(); 35 | 36 | 37 | 38 | @property (nonatomic)float duration; 39 | 40 | 41 | 42 | 43 | 44 | @property (nonatomic, assign, getter = isInteractive) BOOL interactive; 45 | 46 | 47 | /** 48 | * run to end interactive transaction 49 | * 50 | */ 51 | -(void)endInteractiveTranscation:(BOOL)cancelled complition:(void (^)())complitBlock ; 52 | 53 | @property (nonatomic)CFTimeInterval timeOffset; 54 | 55 | 56 | @property (nonatomic)float percent; 57 | @end 58 | -------------------------------------------------------------------------------- /RadialTransitionSource/AAPTransitionDirector.m: -------------------------------------------------------------------------------- 1 | // 2 | // AnimationDirector.m 3 | // RadialTransaction 4 | // 5 | // Created by Alex Padalko on 9/22/14. 6 | // Copyright (c) 2014 Alex Padalko. All rights reserved. 7 | // 8 | 9 | #import "AAPTransitionDirector.h" 10 | #import "UIView+Radial.h" 11 | @interface AAPTransitionDirector(){ 12 | 13 | id _context; 14 | CADisplayLink *_displayLink; 15 | } 16 | @end 17 | @implementation AAPTransitionDirector 18 | 19 | 20 | 21 | -(instancetype)init{ 22 | if (self=[super init]) { 23 | _duration=0.5; 24 | } 25 | return self; 26 | } 27 | 28 | #pragma mark - time offset 29 | - (CFTimeInterval)timeOffset { 30 | return [_context containerView].layer.timeOffset; 31 | } 32 | 33 | - (void)setTimeOffset:(NSTimeInterval)timeOffset { 34 | 35 | [self setPercent:timeOffset/self.duration]; 36 | 37 | } 38 | #pragma mark - update percent 39 | -(void)setPercent:(float)percent{ 40 | _percent=percent; 41 | 42 | [_context updateInteractiveTransition:_percent]; 43 | 44 | [_context containerView].layer.timeOffset = _percent*self.duration; 45 | if (self.interactiveUpdateBlock) { 46 | self.interactiveUpdateBlock(_context,_percent); 47 | } 48 | } 49 | 50 | 51 | #pragma mark - interactiveTransaction ending 52 | -(void)endInteractiveTranscation:(BOOL)cancelled complition:(void (^)())complitBlock { 53 | 54 | if (complitBlock) { 55 | self.interactiveComplitionBlock=complitBlock; 56 | } 57 | 58 | 59 | 60 | if (cancelled) { 61 | _displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(updateCancelAnimation)]; 62 | 63 | 64 | 65 | 66 | } else { 67 | 68 | _displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(updateFinishAnimation)]; 69 | 70 | 71 | } 72 | [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; 73 | 74 | 75 | } 76 | -(void)_transactionFinishFinishing{ 77 | [_displayLink invalidate]; 78 | [_context finishInteractiveTransition]; 79 | [_context completeTransition:YES]; 80 | if (self.interactiveComplitionBlock) { 81 | self.interactiveComplitionBlock(); 82 | } 83 | } 84 | - (void)_transitionFinishedCanceling { 85 | [_displayLink invalidate]; 86 | [_context cancelInteractiveTransition]; 87 | [_context completeTransition:NO]; 88 | 89 | if (self.interactiveComplitionBlock) { 90 | self.interactiveComplitionBlock(); 91 | } 92 | 93 | 94 | } 95 | - (void)updateCancelAnimation { 96 | NSTimeInterval timeOffset = [self timeOffset]-[_displayLink duration]; 97 | if (timeOffset < 0) { 98 | [self _transitionFinishedCanceling]; 99 | } else { 100 | 101 | [self setTimeOffset:timeOffset]; 102 | } 103 | } 104 | 105 | - (void)updateFinishAnimation { 106 | NSTimeInterval timeOffset = [self timeOffset]+[_displayLink duration]; 107 | if (timeOffset > self.duration) { 108 | [self _transactionFinishFinishing]; 109 | } else { 110 | [self setTimeOffset:timeOffset]; 111 | } 112 | } 113 | 114 | 115 | #pragma mark - transaction delegate 116 | -(void)animateTransition:(id)transitionContext { 117 | _context=transitionContext; 118 | UIViewController* toViewController = [_context viewControllerForKey:UITransitionContextToViewControllerKey]; 119 | UIViewController* fromViewController = [_context viewControllerForKey:UITransitionContextFromViewControllerKey]; 120 | UIView * containerView= [_context containerView]; 121 | 122 | [containerView insertSubview:toViewController.view aboveSubview:fromViewController.view]; 123 | if (self.animBlock) { 124 | self.animBlock(transitionContext,[self transitionDuration:transitionContext],^{ 125 | [transitionContext finishInteractiveTransition]; 126 | [transitionContext completeTransition:YES]; 127 | }); 128 | }else{ 129 | [transitionContext finishInteractiveTransition]; 130 | [transitionContext completeTransition:YES]; 131 | } 132 | 133 | 134 | 135 | } 136 | -(void)startInteractiveTransition:(id)transitionContext { 137 | _context=transitionContext; 138 | UIViewController* toViewController = [_context viewControllerForKey:UITransitionContextToViewControllerKey]; 139 | UIViewController* fromViewController = [_context viewControllerForKey:UITransitionContextFromViewControllerKey]; 140 | UIView * containerView= [_context containerView]; 141 | 142 | [containerView insertSubview:toViewController.view aboveSubview:fromViewController.view]; 143 | if (self.animBlock) { 144 | self.animBlock(transitionContext,[self transitionDuration:transitionContext],^{}); 145 | }else{ 146 | [transitionContext finishInteractiveTransition]; 147 | [transitionContext completeTransition:YES]; 148 | } 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | } 157 | -(NSTimeInterval)transitionDuration:(id)transitionContext { 158 | return _duration; 159 | } 160 | 161 | #pragma mark - navigation controller delegate 162 | -(id)navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC { 163 | 164 | return self; 165 | 166 | } 167 | 168 | 169 | -(id)navigationController:(UINavigationController *)navigationController interactionControllerForAnimationController:(id)animationController { 170 | 171 | return self.isInteractive?self:nil; 172 | } 173 | 174 | 175 | @end 176 | -------------------------------------------------------------------------------- /RadialTransitionSource/UINavigationController+RadialTransaction.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+RadialTransaction.h 3 | // RadialTransaction 4 | // 5 | // Created by Alex Padalko on 9/22/14. 6 | // Copyright (c) 2014 Alex Padalko. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | 13 | 14 | @interface UINavigationController(RadialTransaction) 15 | /** 16 | * set default anim time. Default value 0.5 17 | * 18 | */ 19 | +(void)setDefaultRadialAnimationTime:(float)time; 20 | +(float)defaultRadialAnimationTime; 21 | 22 | #pragma mark - PUSH 23 | 24 | 25 | 26 | /** 27 | * radial pushing view controller 28 | * 29 | * @param startFrame where circle start 30 | */ 31 | -(void)radialPushViewController:(UIViewController *)viewController withDuration:(float)duration withStartFrame:(CGRect)rect comlititionBlock:(void(^)())block; 32 | 33 | 34 | 35 | -(void)radialPushViewController:(UIViewController *)viewController withDuration:(float)duration comlititionBlock:(void(^)())block; 36 | 37 | 38 | -(void)radialPushViewController:(UIViewController *)viewController comlititionBlock:(void(^)())block; 39 | 40 | -(void)radialPushViewController:(UIViewController *)viewController withStartFrame:(CGRect)rect comlititionBlock:(void(^)())block; 41 | 42 | 43 | 44 | 45 | #pragma mark - POP 46 | 47 | 48 | /** 49 | * radial pop view controller 50 | * 51 | * @param startFrame where circle start 52 | */ 53 | -(void)radialPopViewControllerWithDuration:(float)duration withStartFrame:(CGRect)rect comlititionBlock:(void(^)())block; 54 | -(void)radialPopViewControllerWithDuration:(float)duration comlititionBlock:(void(^)())block; 55 | 56 | 57 | -(void)radialPopViewControllerWithComlititionBlock:(void(^)())block; 58 | 59 | -(void)radialPopViewControllerWithStartFrame:(CGRect)rect comlititionBlock:(void(^)())block; 60 | 61 | 62 | 63 | #pragma mark - swipe 64 | /** 65 | * enabling swipe back gesture. NOTE interactivePopGestureRecognizer will be disabled 66 | * 67 | */ 68 | -(void)enableRadialSwipe; 69 | -(void)disableRadialSwipe; 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /RadialTransitionSource/UINavigationController+RadialTransaction.m: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+RadialTransaction.m 3 | // RadialTransaction 4 | // 5 | // Created by Alex Padalko on 9/22/14. 6 | // Copyright (c) 2014 Alex Padalko. All rights reserved. 7 | // 8 | 9 | #import "UINavigationController+RadialTransaction.h" 10 | #import "UIView+Radial.h" 11 | #import "AAPTransitionDirector.h" 12 | 13 | 14 | @implementation UINavigationController(RadialTransaction) 15 | 16 | 17 | static float defaultAnimationTime = 0.33; 18 | +(void)setDefaultRadialAnimationTime:(float)time{ 19 | defaultAnimationTime=time; 20 | 21 | } 22 | +(float)defaultRadialAnimationTime{ 23 | return defaultAnimationTime; 24 | } 25 | 26 | #pragma mark - PUSH 27 | -(void)radialPushViewController:(UIViewController *)viewController withDuration:(float)duration comlititionBlock:(void(^)())block{ 28 | 29 | 30 | [self radialPushViewController:viewController withDuration:duration withStartFrame:CGRectMake(self.visibleViewController.view.frame.size.width, self.visibleViewController.view.frame.size.height/2,0, 0) comlititionBlock:block]; 31 | 32 | 33 | } 34 | 35 | -(void)radialPushViewController:(UIViewController *)viewController comlititionBlock:(void(^)())block{ 36 | 37 | [self radialPushViewController:viewController withDuration:defaultAnimationTime withStartFrame:CGRectMake(self.visibleViewController.view.frame.size.width, self.visibleViewController.view.frame.size.height/2,0, 0) comlititionBlock:block]; 38 | 39 | } 40 | 41 | -(void)radialPushViewController:(UIViewController *)viewController withStartFrame:(CGRect)rect comlititionBlock:(void(^)())block{ 42 | 43 | 44 | [self radialPushViewController:viewController withDuration:defaultAnimationTime withStartFrame:rect comlititionBlock:block]; 45 | 46 | 47 | } 48 | 49 | -(void)radialPushViewController:(UIViewController *)viewController withDuration:(float)duration withStartFrame:(CGRect)rect comlititionBlock:(void(^)())block{ 50 | 51 | AAPTransitionDirector * a=[[AAPTransitionDirector alloc]init]; 52 | a.duration=duration; 53 | 54 | a.animBlock=^(id transitionContext,float time,void(^comlitBlock)() ){ 55 | 56 | UIViewController* toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 57 | 58 | [toViewController.view radialAppireanceWithStartFrame:rect duration:time andComplitBLock:comlitBlock]; 59 | 60 | }; 61 | [self setDelegate:a]; 62 | 63 | 64 | 65 | [self pushViewController:viewController animated:YES]; 66 | 67 | self.delegate = nil; 68 | 69 | 70 | 71 | } 72 | 73 | #pragma mark - POP 74 | 75 | 76 | -(void)radialPopViewControllerWithComlititionBlock:(void (^)())block{ 77 | 78 | [self radialPopViewControllerWithDuration:defaultAnimationTime withStartFrame:CGRectMake(0, self.visibleViewController.view.frame.size.height/2, 0, 0) comlititionBlock:block]; 79 | 80 | 81 | } 82 | 83 | -(void)radialPopViewControllerWithDuration:(float)duration comlititionBlock:(void (^)())block{ 84 | 85 | [self radialPopViewControllerWithDuration:duration withStartFrame:CGRectMake(0, self.visibleViewController.view.frame.size.height/2, 0, 0) comlititionBlock:block]; 86 | 87 | } 88 | 89 | -(void)radialPopViewControllerWithStartFrame:(CGRect)rect comlititionBlock:(void (^)())block{ 90 | 91 | [self radialPopViewControllerWithDuration:defaultAnimationTime withStartFrame:rect comlititionBlock:block]; 92 | 93 | } 94 | -(void)radialPopViewControllerWithDuration:(float)duration withStartFrame:(CGRect)rect comlititionBlock:(void (^)())block{ 95 | 96 | AAPTransitionDirector * a=[[AAPTransitionDirector alloc]init]; 97 | 98 | a.duration=duration; 99 | a.animBlock=^(id transitionContext,float time,void(^comlitBlock)() ){ 100 | 101 | UIViewController* toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 102 | [toViewController.view radialAppireanceWithStartFrame:rect duration:time andComplitBLock:comlitBlock]; 103 | 104 | }; 105 | [self setDelegate:a]; 106 | [self popViewControllerAnimated:YES]; 107 | self.delegate = nil; 108 | return; 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | } 117 | 118 | #pragma mark - swipe 119 | 120 | -(void)enableRadialSwipe{ 121 | 122 | 123 | [self enableGesture:YES]; 124 | 125 | } 126 | -(void)disableRadialSwipe{ 127 | 128 | [self enableGesture:NO]; 129 | 130 | } 131 | -(void)enableGesture:(BOOL)enable{ 132 | 133 | 134 | 135 | static NSMutableDictionary * recDictionary=nil; 136 | if (!recDictionary) { 137 | recDictionary=[[NSMutableDictionary alloc]init]; 138 | } 139 | 140 | if (enable) { 141 | if ([self respondsToSelector:@selector(interactivePopGestureRecognizer)]) { 142 | self.interactivePopGestureRecognizer.enabled = NO; 143 | } 144 | UIScreenEdgePanGestureRecognizer * panGesture = [[UIScreenEdgePanGestureRecognizer alloc]initWithTarget:self action:@selector(screenPan:)]; 145 | panGesture.edges=UIRectEdgeLeft; 146 | 147 | 148 | [recDictionary setValue:panGesture forKey:self.description]; 149 | 150 | 151 | 152 | [self.view addGestureRecognizer:panGesture]; 153 | }else { 154 | 155 | [self.view removeGestureRecognizer:[recDictionary valueForKey:self.description]]; 156 | [recDictionary removeObjectForKey:self.description]; 157 | // panGesture = nil; 158 | 159 | } 160 | 161 | } 162 | 163 | 164 | - (void)screenPan:(id)sender { 165 | 166 | 167 | 168 | 169 | UIPanGestureRecognizer *pan = (UIPanGestureRecognizer *)sender; 170 | 171 | UIGestureRecognizerState state = pan.state; 172 | 173 | CGPoint location = [pan locationInView:self.view]; 174 | 175 | static CGPoint firstTouch; 176 | static float d=0; 177 | static AAPTransitionDirector * animDirector=nil; 178 | 179 | 180 | 181 | switch (state) { 182 | case UIGestureRecognizerStateBegan: { 183 | 184 | 185 | animDirector=[[AAPTransitionDirector alloc]init]; 186 | animDirector.interactive=YES; 187 | animDirector.duration=defaultAnimationTime; 188 | [self setDelegate:animDirector]; 189 | [self popViewControllerAnimated:YES]; 190 | 191 | self.delegate = nil; 192 | d=sqrtf(powf(self.visibleViewController.view.frame.size.width*2, 2)+powf(self.visibleViewController.view.frame.size.height*2, 2)); 193 | firstTouch=location; 194 | 195 | animDirector.animBlock=^(id transitionContext,float time,void(^comlitBlock)() ){ 196 | 197 | 198 | UIViewController* toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 199 | 200 | CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; 201 | CGRect maskRect = CGRectMake(location.x-location.x/2, location.y-location.x/2, 0, 0); 202 | CGPathRef path = CGPathCreateWithEllipseInRect(maskRect, NULL); 203 | maskLayer.path = path; 204 | 205 | maskLayer.path=path; 206 | toViewController.view.layer.mask = maskLayer; 207 | CGPathRelease(path); 208 | }; 209 | 210 | 211 | 212 | break; 213 | } 214 | case UIGestureRecognizerStateChanged: { 215 | 216 | 217 | animDirector.interactiveUpdateBlock=^(id transitionContext,float percent){ 218 | 219 | CAShapeLayer *maskLayer =(CAShapeLayer*)[transitionContext viewControllerForKey:UITransitionContextToViewControllerKey].view.layer.mask; 220 | float mainD= percent*d; 221 | 222 | 223 | CGRect maskRect = CGRectMake(-mainD/2, location.y-mainD/2, mainD, mainD); 224 | CGMutablePathRef p1 = CGPathCreateMutable(); 225 | CGPathAddPath(p1, nil, CGPathCreateWithEllipseInRect(maskRect, nil)); 226 | maskLayer.path=p1; 227 | 228 | }; 229 | 230 | 231 | float mainD= location.x*d/self.view.frame.size.width; 232 | 233 | [animDirector setPercent:mainD/d]; 234 | 235 | 236 | 237 | break; 238 | } 239 | default: { 240 | 241 | float mainD= location.x*d/self.view.frame.size.width; 242 | 243 | BOOL canceled= mainD>d*0.5?NO:YES; 244 | 245 | [animDirector endInteractiveTranscation:canceled complition:^{ 246 | animDirector = nil; 247 | self.delegate = nil; 248 | }]; 249 | 250 | break; 251 | 252 | } 253 | } 254 | } 255 | 256 | 257 | 258 | 259 | @end 260 | -------------------------------------------------------------------------------- /RadialTransitionSource/UIView+Radial.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Radial.h 3 | // RadialTransaction 4 | // 5 | // Created by Alex Padalko on 9/22/14. 6 | // Copyright (c) 2014 Alex Padalko. All rights reserved. 7 | // 8 | 9 | #import 10 | @interface Animator: NSObject 11 | -(void)startAnimation:(void(^)())complBlock; 12 | -(instancetype)initWithLayer:(CALayer*)layer andAnimation:(CAAnimation*)anim; 13 | @end; 14 | @interface UIView(Radial) 15 | -(void)radialAppireanceWithStartFrame:(CGRect)startFrame duration:(CGFloat)duration andComplitBLock:(void(^)())complBlock; 16 | -(void)radialDissmisWithStartFrame:(CGRect)startFrame duration:(CGFloat)duration andComplitBLock:(void (^)())complBlock; 17 | @end 18 | -------------------------------------------------------------------------------- /RadialTransitionSource/UIView+Radial.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Radial.m 3 | // RadialTransaction 4 | // 5 | // Created by Alex Padalko on 9/22/14. 6 | // Copyright (c) 2014 Alex Padalko. All rights reserved. 7 | // 8 | 9 | #import "UIView+Radial.h" 10 | #pragma mark - ANIMATOR 11 | typedef void(^animatorCompletionBlock)(); 12 | @interface Animator() 13 | { 14 | animatorCompletionBlock completitionBlock; 15 | 16 | CALayer * animLayer; 17 | CAAnimation * caAnimation; 18 | } 19 | @end 20 | @implementation Animator 21 | -(void)startAnimation:(void(^)())complBlock{ 22 | completitionBlock=complBlock; 23 | [animLayer addAnimation:caAnimation forKey:@"animator"]; 24 | } 25 | 26 | -(instancetype)initWithLayer:(CALayer*)layer andAnimation:(CAAnimation*)anim{ 27 | if (self=[super init]) { 28 | animLayer=layer; 29 | caAnimation=anim; 30 | [anim setDelegate:self]; 31 | } 32 | return self; 33 | 34 | } 35 | -(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{ 36 | 37 | completitionBlock(); 38 | 39 | } 40 | @end 41 | 42 | #pragma mark - Radial 43 | @implementation UIView(Radial) 44 | -(void)radialDissmisWithStartFrame:(CGRect)startFrame duration:(CGFloat)duration andComplitBLock:(void (^)())complBlock{ 45 | 46 | CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; 47 | maskLayer.backgroundColor=[UIColor greenColor].CGColor; 48 | maskLayer.fillRule = kCAFillRuleEvenOdd; 49 | CGRect maskRect = startFrame; 50 | 51 | CGPathRef path = CGPathCreateWithEllipseInRect(maskRect, NULL); 52 | float d=sqrtf(powf(self.frame.size.width, 2)+powf(self.frame.size.height, 2)); 53 | d*=2; 54 | 55 | CGRect newR= CGRectMake(self.frame.size.width/2-d/2 ,maskRect.origin.y-d/2, d, d); 56 | 57 | 58 | 59 | CGMutablePathRef p1 = CGPathCreateMutable(); 60 | CGPathAddPath(p1, nil, CGPathCreateWithEllipseInRect(maskRect, nil)); 61 | CGPathAddPath(p1, nil, CGPathCreateWithEllipseInRect(newR, nil)); 62 | 63 | CGMutablePathRef p2 = CGPathCreateMutable(); 64 | CGPathAddPath(p2, nil, CGPathCreateWithEllipseInRect(newR, nil)); 65 | CGPathAddPath(p2, nil, CGPathCreateWithEllipseInRect(newR, nil)); 66 | 67 | 68 | 69 | 70 | self.layer.mask = maskLayer; 71 | 72 | CABasicAnimation* revealAnimation = [CABasicAnimation animationWithKeyPath:@"path"]; 73 | revealAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; 74 | revealAnimation.fromValue = (__bridge id)(p1); 75 | revealAnimation.toValue = (__bridge id)(p2); 76 | revealAnimation.duration =duration; 77 | maskLayer.path = p2; 78 | CGPathRelease(path); 79 | 80 | Animator * a=[[Animator alloc]initWithLayer:maskLayer andAnimation:revealAnimation]; 81 | 82 | [a startAnimation:^{ 83 | 84 | complBlock(); 85 | 86 | 87 | }]; 88 | 89 | } 90 | -(void)radialAppireanceWithStartFrame:(CGRect)startFrame duration:(CGFloat)duration andComplitBLock:(void(^)())complBlock{ 91 | 92 | CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; 93 | CGRect maskRect = startFrame; 94 | 95 | CGPathRef path = CGPathCreateWithEllipseInRect(maskRect, NULL); 96 | maskLayer.path = path; 97 | 98 | float d=sqrtf(powf(self.frame.size.width, 2)+powf(self.frame.size.height, 2)); 99 | d*=2; 100 | 101 | CGRect newR= CGRectMake(self.frame.size.width/2-d/2 ,maskRect.origin.y-d/2, d, d); 102 | CGPathRef newPath = CGPathCreateWithEllipseInRect(newR, NULL); 103 | 104 | self.layer.mask = maskLayer; 105 | 106 | CABasicAnimation* revealAnimation = [CABasicAnimation animationWithKeyPath:@"path"]; 107 | revealAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; 108 | revealAnimation.fromValue = (__bridge id)(path); 109 | revealAnimation.toValue = (__bridge id)(newPath); 110 | revealAnimation.duration =duration; 111 | maskLayer.path = newPath; 112 | CGPathRelease(path); 113 | 114 | Animator * a=[[Animator alloc]initWithLayer:maskLayer andAnimation:revealAnimation]; 115 | 116 | [a startAnimation:^{ 117 | [maskLayer removeFromSuperlayer]; 118 | complBlock(); 119 | 120 | 121 | }]; 122 | 123 | 124 | } 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /radialDemo_short.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apadalko/RadialTransition_objC/48944bd4002fc59112cb1749c3179339bd9c3cf1/radialDemo_short.gif -------------------------------------------------------------------------------- /radilaDemo_long.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apadalko/RadialTransition_objC/48944bd4002fc59112cb1749c3179339bd9c3cf1/radilaDemo_long.gif --------------------------------------------------------------------------------