├── .gitignore ├── Assets ├── animation.gif ├── screen_shot1.png └── screen_shot2.png ├── LICENSE ├── PathDynamicModal-Demo.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── PathDynamicModal-Demo ├── AppDelegate.swift ├── Base.lproj │ └── Main.storyboard ├── ImageCell.swift ├── ImageCell.xib ├── ImageModalView.swift ├── ImageModalView.xib ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Icon │ │ ├── icon_close.imageset │ │ │ ├── 1423620400_icon-close-circled-128.png │ │ │ └── Contents.json │ │ └── icon_face.imageset │ │ │ ├── Contents.json │ │ │ └── icon_smile.png │ ├── LaunchImage.launchimage │ │ └── Contents.json │ └── Sample │ │ ├── SampleImage1.imageset │ │ ├── Contents.json │ │ └── SampleImage1.jpg │ │ ├── SampleImage10.imageset │ │ ├── Contents.json │ │ └── SampleImage10.jpg │ │ ├── SampleImage11.imageset │ │ ├── Contents.json │ │ └── SampleImage11.jpg │ │ ├── SampleImage12.imageset │ │ ├── Contents.json │ │ └── SampleImage12.jpg │ │ ├── SampleImage13.imageset │ │ ├── Contents.json │ │ └── SampleImage13.jpg │ │ ├── SampleImage14.imageset │ │ ├── Contents.json │ │ └── SampleImage14.jpg │ │ ├── SampleImage15.imageset │ │ ├── Contents.json │ │ └── SampleImage15.jpg │ │ ├── SampleImage16.imageset │ │ ├── Contents.json │ │ └── SampleImage16.jpg │ │ ├── SampleImage2.imageset │ │ ├── Contents.json │ │ └── SampleImage2.jpg │ │ ├── SampleImage3.imageset │ │ ├── Contents.json │ │ └── SampleImage3.jpg │ │ ├── SampleImage4.imageset │ │ ├── Contents.json │ │ └── SampleImage4.jpg │ │ ├── SampleImage5.imageset │ │ ├── Contents.json │ │ └── SampleImage5.jpg │ │ ├── SampleImage6.imageset │ │ ├── Contents.json │ │ └── SampleImage6.jpg │ │ ├── SampleImage7.imageset │ │ ├── Contents.json │ │ └── SampleImage7.jpg │ │ ├── SampleImage8.imageset │ │ ├── Contents.json │ │ └── SampleImage8.jpg │ │ └── SampleImage9.imageset │ │ ├── Contents.json │ │ └── SampleImage9.jpg ├── Info.plist ├── LaunchScreen.xib ├── ModalView.swift ├── ModalView.xib └── ViewController.swift ├── PathDynamicModal-DemoTests ├── Info.plist └── PathDynamicModal_DemoTests.swift ├── PathDynamicModal └── PathDynamicModal.swift └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # We recommend against adding the Pods directory to your .gitignore. However 26 | # you should judge for yourself, the pros and cons are mentioned at: 27 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 28 | # 29 | # Note: if you ignore the Pods directory, make sure to uncomment 30 | # `pod install` in .travis.yml 31 | # 32 | # Pods/ 33 | -------------------------------------------------------------------------------- /Assets/animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/Assets/animation.gif -------------------------------------------------------------------------------- /Assets/screen_shot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/Assets/screen_shot1.png -------------------------------------------------------------------------------- /Assets/screen_shot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/Assets/screen_shot2.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 ra1028 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. -------------------------------------------------------------------------------- /PathDynamicModal-Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2A2405EE1A87ED4A00371941 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A2405ED1A87ED4A00371941 /* AppDelegate.swift */; }; 11 | 2A2405F01A87ED4A00371941 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A2405EF1A87ED4A00371941 /* ViewController.swift */; }; 12 | 2A2405F31A87ED4A00371941 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2A2405F11A87ED4A00371941 /* Main.storyboard */; }; 13 | 2A2405F51A87ED4A00371941 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2A2405F41A87ED4A00371941 /* Images.xcassets */; }; 14 | 2A2406041A87ED4A00371941 /* PathDynamicModal_DemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A2406031A87ED4A00371941 /* PathDynamicModal_DemoTests.swift */; }; 15 | 2A24060F1A87EDDA00371941 /* PathDynamicModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A24060E1A87EDDA00371941 /* PathDynamicModal.swift */; }; 16 | 2A7F093A1A8BEDB700209AFB /* ImageModalView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2A7F09391A8BEDB700209AFB /* ImageModalView.xib */; }; 17 | 2A7F093C1A8BEFAB00209AFB /* ImageModalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A7F093B1A8BEFAB00209AFB /* ImageModalView.swift */; }; 18 | 2ABA494D1A8BD97300646411 /* ImageCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2ABA494C1A8BD97300646411 /* ImageCell.xib */; }; 19 | 2ABA494F1A8BDAE400646411 /* ImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2ABA494E1A8BDAE400646411 /* ImageCell.swift */; }; 20 | 2AE6653F1A8A9CB20048AFF2 /* ModalView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2AE6653E1A8A9CB20048AFF2 /* ModalView.xib */; }; 21 | 2AE665411A8AA64F0048AFF2 /* ModalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AE665401A8AA64F0048AFF2 /* ModalView.swift */; }; 22 | 2AE665461A8BCC6A0048AFF2 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2AE665451A8BCC6A0048AFF2 /* LaunchScreen.xib */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXContainerItemProxy section */ 26 | 2A2405FE1A87ED4A00371941 /* PBXContainerItemProxy */ = { 27 | isa = PBXContainerItemProxy; 28 | containerPortal = 2A2405E01A87ED4A00371941 /* Project object */; 29 | proxyType = 1; 30 | remoteGlobalIDString = 2A2405E71A87ED4A00371941; 31 | remoteInfo = "PathDynamicModal-Demo"; 32 | }; 33 | /* End PBXContainerItemProxy section */ 34 | 35 | /* Begin PBXFileReference section */ 36 | 2A2405E81A87ED4A00371941 /* PathDynamicModal-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "PathDynamicModal-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 2A2405EC1A87ED4A00371941 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | 2A2405ED1A87ED4A00371941 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39 | 2A2405EF1A87ED4A00371941 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 40 | 2A2405F21A87ED4A00371941 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 41 | 2A2405F41A87ED4A00371941 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 42 | 2A2405FD1A87ED4A00371941 /* PathDynamicModal-DemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "PathDynamicModal-DemoTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 2A2406021A87ED4A00371941 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | 2A2406031A87ED4A00371941 /* PathDynamicModal_DemoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PathDynamicModal_DemoTests.swift; sourceTree = ""; }; 45 | 2A24060E1A87EDDA00371941 /* PathDynamicModal.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PathDynamicModal.swift; sourceTree = ""; }; 46 | 2A7F09391A8BEDB700209AFB /* ImageModalView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ImageModalView.xib; sourceTree = ""; }; 47 | 2A7F093B1A8BEFAB00209AFB /* ImageModalView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageModalView.swift; sourceTree = ""; }; 48 | 2ABA494C1A8BD97300646411 /* ImageCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ImageCell.xib; sourceTree = ""; }; 49 | 2ABA494E1A8BDAE400646411 /* ImageCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCell.swift; sourceTree = ""; }; 50 | 2AE6653E1A8A9CB20048AFF2 /* ModalView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ModalView.xib; sourceTree = ""; }; 51 | 2AE665401A8AA64F0048AFF2 /* ModalView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ModalView.swift; sourceTree = ""; }; 52 | 2AE665451A8BCC6A0048AFF2 /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | 2A2405E51A87ED4A00371941 /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | 2A2405FA1A87ED4A00371941 /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | /* End PBXFrameworksBuildPhase section */ 71 | 72 | /* Begin PBXGroup section */ 73 | 2A2405DF1A87ED4A00371941 = { 74 | isa = PBXGroup; 75 | children = ( 76 | 2A24060D1A87ED8D00371941 /* PathDynamicModal */, 77 | 2A2405EA1A87ED4A00371941 /* PathDynamicModal-Demo */, 78 | 2A2406001A87ED4A00371941 /* PathDynamicModal-DemoTests */, 79 | 2A2405E91A87ED4A00371941 /* Products */, 80 | ); 81 | sourceTree = ""; 82 | }; 83 | 2A2405E91A87ED4A00371941 /* Products */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 2A2405E81A87ED4A00371941 /* PathDynamicModal-Demo.app */, 87 | 2A2405FD1A87ED4A00371941 /* PathDynamicModal-DemoTests.xctest */, 88 | ); 89 | name = Products; 90 | sourceTree = ""; 91 | }; 92 | 2A2405EA1A87ED4A00371941 /* PathDynamicModal-Demo */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 2A2405ED1A87ED4A00371941 /* AppDelegate.swift */, 96 | 2A2405EF1A87ED4A00371941 /* ViewController.swift */, 97 | 2ABA494E1A8BDAE400646411 /* ImageCell.swift */, 98 | 2AE665401A8AA64F0048AFF2 /* ModalView.swift */, 99 | 2A7F093B1A8BEFAB00209AFB /* ImageModalView.swift */, 100 | 2ABA494C1A8BD97300646411 /* ImageCell.xib */, 101 | 2A7F09391A8BEDB700209AFB /* ImageModalView.xib */, 102 | 2AE6653E1A8A9CB20048AFF2 /* ModalView.xib */, 103 | 2A2405F11A87ED4A00371941 /* Main.storyboard */, 104 | 2AE665451A8BCC6A0048AFF2 /* LaunchScreen.xib */, 105 | 2A2405F41A87ED4A00371941 /* Images.xcassets */, 106 | 2A2405EB1A87ED4A00371941 /* Supporting Files */, 107 | ); 108 | path = "PathDynamicModal-Demo"; 109 | sourceTree = ""; 110 | }; 111 | 2A2405EB1A87ED4A00371941 /* Supporting Files */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | 2A2405EC1A87ED4A00371941 /* Info.plist */, 115 | ); 116 | name = "Supporting Files"; 117 | sourceTree = ""; 118 | }; 119 | 2A2406001A87ED4A00371941 /* PathDynamicModal-DemoTests */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 2A2406031A87ED4A00371941 /* PathDynamicModal_DemoTests.swift */, 123 | 2A2406011A87ED4A00371941 /* Supporting Files */, 124 | ); 125 | path = "PathDynamicModal-DemoTests"; 126 | sourceTree = ""; 127 | }; 128 | 2A2406011A87ED4A00371941 /* Supporting Files */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 2A2406021A87ED4A00371941 /* Info.plist */, 132 | ); 133 | name = "Supporting Files"; 134 | sourceTree = ""; 135 | }; 136 | 2A24060D1A87ED8D00371941 /* PathDynamicModal */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 2A24060E1A87EDDA00371941 /* PathDynamicModal.swift */, 140 | ); 141 | path = PathDynamicModal; 142 | sourceTree = ""; 143 | }; 144 | /* End PBXGroup section */ 145 | 146 | /* Begin PBXNativeTarget section */ 147 | 2A2405E71A87ED4A00371941 /* PathDynamicModal-Demo */ = { 148 | isa = PBXNativeTarget; 149 | buildConfigurationList = 2A2406071A87ED4A00371941 /* Build configuration list for PBXNativeTarget "PathDynamicModal-Demo" */; 150 | buildPhases = ( 151 | 2A2405E41A87ED4A00371941 /* Sources */, 152 | 2A2405E51A87ED4A00371941 /* Frameworks */, 153 | 2A2405E61A87ED4A00371941 /* Resources */, 154 | ); 155 | buildRules = ( 156 | ); 157 | dependencies = ( 158 | ); 159 | name = "PathDynamicModal-Demo"; 160 | productName = "PathDynamicModal-Demo"; 161 | productReference = 2A2405E81A87ED4A00371941 /* PathDynamicModal-Demo.app */; 162 | productType = "com.apple.product-type.application"; 163 | }; 164 | 2A2405FC1A87ED4A00371941 /* PathDynamicModal-DemoTests */ = { 165 | isa = PBXNativeTarget; 166 | buildConfigurationList = 2A24060A1A87ED4A00371941 /* Build configuration list for PBXNativeTarget "PathDynamicModal-DemoTests" */; 167 | buildPhases = ( 168 | 2A2405F91A87ED4A00371941 /* Sources */, 169 | 2A2405FA1A87ED4A00371941 /* Frameworks */, 170 | 2A2405FB1A87ED4A00371941 /* Resources */, 171 | ); 172 | buildRules = ( 173 | ); 174 | dependencies = ( 175 | 2A2405FF1A87ED4A00371941 /* PBXTargetDependency */, 176 | ); 177 | name = "PathDynamicModal-DemoTests"; 178 | productName = "PathDynamicModal-DemoTests"; 179 | productReference = 2A2405FD1A87ED4A00371941 /* PathDynamicModal-DemoTests.xctest */; 180 | productType = "com.apple.product-type.bundle.unit-test"; 181 | }; 182 | /* End PBXNativeTarget section */ 183 | 184 | /* Begin PBXProject section */ 185 | 2A2405E01A87ED4A00371941 /* Project object */ = { 186 | isa = PBXProject; 187 | attributes = { 188 | LastSwiftMigration = 0700; 189 | LastSwiftUpdateCheck = 0700; 190 | LastUpgradeCheck = 0610; 191 | ORGANIZATIONNAME = "Ryo Aoyama"; 192 | TargetAttributes = { 193 | 2A2405E71A87ED4A00371941 = { 194 | CreatedOnToolsVersion = 6.1.1; 195 | }; 196 | 2A2405FC1A87ED4A00371941 = { 197 | CreatedOnToolsVersion = 6.1.1; 198 | TestTargetID = 2A2405E71A87ED4A00371941; 199 | }; 200 | }; 201 | }; 202 | buildConfigurationList = 2A2405E31A87ED4A00371941 /* Build configuration list for PBXProject "PathDynamicModal-Demo" */; 203 | compatibilityVersion = "Xcode 3.2"; 204 | developmentRegion = English; 205 | hasScannedForEncodings = 0; 206 | knownRegions = ( 207 | en, 208 | Base, 209 | ); 210 | mainGroup = 2A2405DF1A87ED4A00371941; 211 | productRefGroup = 2A2405E91A87ED4A00371941 /* Products */; 212 | projectDirPath = ""; 213 | projectRoot = ""; 214 | targets = ( 215 | 2A2405E71A87ED4A00371941 /* PathDynamicModal-Demo */, 216 | 2A2405FC1A87ED4A00371941 /* PathDynamicModal-DemoTests */, 217 | ); 218 | }; 219 | /* End PBXProject section */ 220 | 221 | /* Begin PBXResourcesBuildPhase section */ 222 | 2A2405E61A87ED4A00371941 /* Resources */ = { 223 | isa = PBXResourcesBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | 2A7F093A1A8BEDB700209AFB /* ImageModalView.xib in Resources */, 227 | 2AE665461A8BCC6A0048AFF2 /* LaunchScreen.xib in Resources */, 228 | 2A2405F31A87ED4A00371941 /* Main.storyboard in Resources */, 229 | 2AE6653F1A8A9CB20048AFF2 /* ModalView.xib in Resources */, 230 | 2ABA494D1A8BD97300646411 /* ImageCell.xib in Resources */, 231 | 2A2405F51A87ED4A00371941 /* Images.xcassets in Resources */, 232 | ); 233 | runOnlyForDeploymentPostprocessing = 0; 234 | }; 235 | 2A2405FB1A87ED4A00371941 /* Resources */ = { 236 | isa = PBXResourcesBuildPhase; 237 | buildActionMask = 2147483647; 238 | files = ( 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | /* End PBXResourcesBuildPhase section */ 243 | 244 | /* Begin PBXSourcesBuildPhase section */ 245 | 2A2405E41A87ED4A00371941 /* Sources */ = { 246 | isa = PBXSourcesBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | 2A24060F1A87EDDA00371941 /* PathDynamicModal.swift in Sources */, 250 | 2A2405F01A87ED4A00371941 /* ViewController.swift in Sources */, 251 | 2A7F093C1A8BEFAB00209AFB /* ImageModalView.swift in Sources */, 252 | 2AE665411A8AA64F0048AFF2 /* ModalView.swift in Sources */, 253 | 2A2405EE1A87ED4A00371941 /* AppDelegate.swift in Sources */, 254 | 2ABA494F1A8BDAE400646411 /* ImageCell.swift in Sources */, 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | }; 258 | 2A2405F91A87ED4A00371941 /* Sources */ = { 259 | isa = PBXSourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | 2A2406041A87ED4A00371941 /* PathDynamicModal_DemoTests.swift in Sources */, 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | /* End PBXSourcesBuildPhase section */ 267 | 268 | /* Begin PBXTargetDependency section */ 269 | 2A2405FF1A87ED4A00371941 /* PBXTargetDependency */ = { 270 | isa = PBXTargetDependency; 271 | target = 2A2405E71A87ED4A00371941 /* PathDynamicModal-Demo */; 272 | targetProxy = 2A2405FE1A87ED4A00371941 /* PBXContainerItemProxy */; 273 | }; 274 | /* End PBXTargetDependency section */ 275 | 276 | /* Begin PBXVariantGroup section */ 277 | 2A2405F11A87ED4A00371941 /* Main.storyboard */ = { 278 | isa = PBXVariantGroup; 279 | children = ( 280 | 2A2405F21A87ED4A00371941 /* Base */, 281 | ); 282 | name = Main.storyboard; 283 | sourceTree = ""; 284 | }; 285 | /* End PBXVariantGroup section */ 286 | 287 | /* Begin XCBuildConfiguration section */ 288 | 2A2406051A87ED4A00371941 /* Debug */ = { 289 | isa = XCBuildConfiguration; 290 | buildSettings = { 291 | ALWAYS_SEARCH_USER_PATHS = NO; 292 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 293 | CLANG_CXX_LIBRARY = "libc++"; 294 | CLANG_ENABLE_MODULES = YES; 295 | CLANG_ENABLE_OBJC_ARC = YES; 296 | CLANG_WARN_BOOL_CONVERSION = YES; 297 | CLANG_WARN_CONSTANT_CONVERSION = YES; 298 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 299 | CLANG_WARN_EMPTY_BODY = YES; 300 | CLANG_WARN_ENUM_CONVERSION = YES; 301 | CLANG_WARN_INT_CONVERSION = YES; 302 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 303 | CLANG_WARN_UNREACHABLE_CODE = YES; 304 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 305 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 306 | COPY_PHASE_STRIP = NO; 307 | ENABLE_STRICT_OBJC_MSGSEND = YES; 308 | GCC_C_LANGUAGE_STANDARD = gnu99; 309 | GCC_DYNAMIC_NO_PIC = NO; 310 | GCC_OPTIMIZATION_LEVEL = 0; 311 | GCC_PREPROCESSOR_DEFINITIONS = ( 312 | "DEBUG=1", 313 | "$(inherited)", 314 | ); 315 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 316 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 317 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 318 | GCC_WARN_UNDECLARED_SELECTOR = YES; 319 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 320 | GCC_WARN_UNUSED_FUNCTION = YES; 321 | GCC_WARN_UNUSED_VARIABLE = YES; 322 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 323 | MTL_ENABLE_DEBUG_INFO = YES; 324 | ONLY_ACTIVE_ARCH = YES; 325 | SDKROOT = iphoneos; 326 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 327 | }; 328 | name = Debug; 329 | }; 330 | 2A2406061A87ED4A00371941 /* Release */ = { 331 | isa = XCBuildConfiguration; 332 | buildSettings = { 333 | ALWAYS_SEARCH_USER_PATHS = NO; 334 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 335 | CLANG_CXX_LIBRARY = "libc++"; 336 | CLANG_ENABLE_MODULES = YES; 337 | CLANG_ENABLE_OBJC_ARC = YES; 338 | CLANG_WARN_BOOL_CONVERSION = YES; 339 | CLANG_WARN_CONSTANT_CONVERSION = YES; 340 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 341 | CLANG_WARN_EMPTY_BODY = YES; 342 | CLANG_WARN_ENUM_CONVERSION = YES; 343 | CLANG_WARN_INT_CONVERSION = YES; 344 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 345 | CLANG_WARN_UNREACHABLE_CODE = YES; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 348 | COPY_PHASE_STRIP = YES; 349 | ENABLE_NS_ASSERTIONS = NO; 350 | ENABLE_STRICT_OBJC_MSGSEND = YES; 351 | GCC_C_LANGUAGE_STANDARD = gnu99; 352 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 353 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 354 | GCC_WARN_UNDECLARED_SELECTOR = YES; 355 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 356 | GCC_WARN_UNUSED_FUNCTION = YES; 357 | GCC_WARN_UNUSED_VARIABLE = YES; 358 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 359 | MTL_ENABLE_DEBUG_INFO = NO; 360 | SDKROOT = iphoneos; 361 | VALIDATE_PRODUCT = YES; 362 | }; 363 | name = Release; 364 | }; 365 | 2A2406081A87ED4A00371941 /* Debug */ = { 366 | isa = XCBuildConfiguration; 367 | buildSettings = { 368 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 369 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 370 | INFOPLIST_FILE = "PathDynamicModal-Demo/Info.plist"; 371 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 372 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 373 | PRODUCT_NAME = "PathDynamicModal-Demo"; 374 | }; 375 | name = Debug; 376 | }; 377 | 2A2406091A87ED4A00371941 /* Release */ = { 378 | isa = XCBuildConfiguration; 379 | buildSettings = { 380 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 381 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 382 | INFOPLIST_FILE = "PathDynamicModal-Demo/Info.plist"; 383 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 384 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 385 | PRODUCT_NAME = "PathDynamicModal-Demo"; 386 | }; 387 | name = Release; 388 | }; 389 | 2A24060B1A87ED4A00371941 /* Debug */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | BUNDLE_LOADER = "$(TEST_HOST)"; 393 | FRAMEWORK_SEARCH_PATHS = ( 394 | "$(SDKROOT)/Developer/Library/Frameworks", 395 | "$(inherited)", 396 | ); 397 | GCC_PREPROCESSOR_DEFINITIONS = ( 398 | "DEBUG=1", 399 | "$(inherited)", 400 | ); 401 | INFOPLIST_FILE = "PathDynamicModal-DemoTests/Info.plist"; 402 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 403 | PRODUCT_NAME = "PathDynamicModal-DemoTests"; 404 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PathDynamicModal-Demo.app/PathDynamicModal-Demo"; 405 | }; 406 | name = Debug; 407 | }; 408 | 2A24060C1A87ED4A00371941 /* Release */ = { 409 | isa = XCBuildConfiguration; 410 | buildSettings = { 411 | BUNDLE_LOADER = "$(TEST_HOST)"; 412 | FRAMEWORK_SEARCH_PATHS = ( 413 | "$(SDKROOT)/Developer/Library/Frameworks", 414 | "$(inherited)", 415 | ); 416 | INFOPLIST_FILE = "PathDynamicModal-DemoTests/Info.plist"; 417 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 418 | PRODUCT_NAME = "PathDynamicModal-DemoTests"; 419 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PathDynamicModal-Demo.app/PathDynamicModal-Demo"; 420 | }; 421 | name = Release; 422 | }; 423 | /* End XCBuildConfiguration section */ 424 | 425 | /* Begin XCConfigurationList section */ 426 | 2A2405E31A87ED4A00371941 /* Build configuration list for PBXProject "PathDynamicModal-Demo" */ = { 427 | isa = XCConfigurationList; 428 | buildConfigurations = ( 429 | 2A2406051A87ED4A00371941 /* Debug */, 430 | 2A2406061A87ED4A00371941 /* Release */, 431 | ); 432 | defaultConfigurationIsVisible = 0; 433 | defaultConfigurationName = Release; 434 | }; 435 | 2A2406071A87ED4A00371941 /* Build configuration list for PBXNativeTarget "PathDynamicModal-Demo" */ = { 436 | isa = XCConfigurationList; 437 | buildConfigurations = ( 438 | 2A2406081A87ED4A00371941 /* Debug */, 439 | 2A2406091A87ED4A00371941 /* Release */, 440 | ); 441 | defaultConfigurationIsVisible = 0; 442 | defaultConfigurationName = Release; 443 | }; 444 | 2A24060A1A87ED4A00371941 /* Build configuration list for PBXNativeTarget "PathDynamicModal-DemoTests" */ = { 445 | isa = XCConfigurationList; 446 | buildConfigurations = ( 447 | 2A24060B1A87ED4A00371941 /* Debug */, 448 | 2A24060C1A87ED4A00371941 /* Release */, 449 | ); 450 | defaultConfigurationIsVisible = 0; 451 | defaultConfigurationName = Release; 452 | }; 453 | /* End XCConfigurationList section */ 454 | }; 455 | rootObject = 2A2405E01A87ED4A00371941 /* Project object */; 456 | } 457 | -------------------------------------------------------------------------------- /PathDynamicModal-Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PathDynamicModal-Demo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // PathDynamicModal-Demo 4 | // 5 | // Created by Ryo Aoyama on 2/9/15. 6 | // Copyright (c) 2015 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication) { 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 | func applicationDidBecomeActive(application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 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 | -------------------------------------------------------------------------------- /PathDynamicModal-Demo/ImageCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageCell.swift 3 | // PathDynamicModal-Demo 4 | // 5 | // Created by Ryo Aoyama on 2/12/15. 6 | // Copyright (c) 2015 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ImageCell: UITableViewCell { 12 | @IBOutlet private var sideImageView: UIImageView! 13 | @IBOutlet private var titleLabel: UILabel! 14 | 15 | var sideImage: UIImage? { 16 | set { 17 | self.sideImageView.image = newValue 18 | } 19 | get { 20 | return self.sideImageView.image 21 | } 22 | } 23 | 24 | var title: String? { 25 | set { 26 | self.titleLabel.text = newValue 27 | } 28 | get { 29 | return self.titleLabel.text 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/ImageCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /PathDynamicModal-Demo/ImageModalView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageModalView.swift 3 | // PathDynamicModal-Demo 4 | // 5 | // Created by Ryo Aoyama on 2/12/15. 6 | // Copyright (c) 2015 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ImageModalView: UIView { 12 | var bottomButtonHandler: (() -> Void)? 13 | var closeButtonHandler: (() -> Void)? 14 | var image: UIImage? { 15 | set { 16 | self.imageView.image = newValue 17 | } 18 | get { 19 | return self.imageView.image 20 | } 21 | } 22 | 23 | @IBOutlet private var imageView: UIImageView! 24 | @IBOutlet private var closeButton: UIButton! 25 | @IBOutlet private var contentView: UIView! 26 | 27 | override func awakeFromNib() { 28 | super.awakeFromNib() 29 | self.configure() 30 | } 31 | 32 | private func configure() { 33 | self.contentView.layer.cornerRadius = 5.0 34 | self.closeButton.layer.cornerRadius = CGRectGetHeight(self.closeButton.bounds) / 2.0 35 | self.closeButton.layer.shadowColor = UIColor.blackColor().CGColor 36 | self.closeButton.layer.shadowOffset = CGSizeZero 37 | self.closeButton.layer.shadowOpacity = 0.3 38 | self.closeButton.layer.shadowRadius = 2.0 39 | } 40 | 41 | class func instantiateFromNib() -> ImageModalView { 42 | let view = UINib(nibName: "ImageModalView", bundle: nil).instantiateWithOwner(nil, options: nil).first as! ImageModalView 43 | 44 | return view 45 | } 46 | 47 | @IBAction func handleCloseButton(sender: UIButton) { 48 | self.closeButtonHandler?() 49 | } 50 | 51 | @IBAction func handleBottomButton(sender: UIButton) { 52 | self.bottomButtonHandler?() 53 | } 54 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/ImageModalView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 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 | -------------------------------------------------------------------------------- /PathDynamicModal-Demo/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 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Icon/icon_close.imageset/1423620400_icon-close-circled-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Icon/icon_close.imageset/1423620400_icon-close-circled-128.png -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Icon/icon_close.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "1423620400_icon-close-circled-128.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Icon/icon_face.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "icon_smile.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Icon/icon_face.imageset/icon_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Icon/icon_face.imageset/icon_smile.png -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "minimum-system-version" : "7.0", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "orientation" : "portrait", 11 | "idiom" : "iphone", 12 | "minimum-system-version" : "7.0", 13 | "subtype" : "retina4", 14 | "scale" : "2x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage1.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage1.imageset/SampleImage1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage1.imageset/SampleImage1.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage10.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage10.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage10.imageset/SampleImage10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage10.imageset/SampleImage10.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage11.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage11.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage11.imageset/SampleImage11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage11.imageset/SampleImage11.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage12.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage12.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage12.imageset/SampleImage12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage12.imageset/SampleImage12.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage13.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage13.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage13.imageset/SampleImage13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage13.imageset/SampleImage13.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage14.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage14.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage14.imageset/SampleImage14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage14.imageset/SampleImage14.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage15.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage15.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage15.imageset/SampleImage15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage15.imageset/SampleImage15.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage16.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage16.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage16.imageset/SampleImage16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage16.imageset/SampleImage16.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage2.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage2.imageset/SampleImage2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage2.imageset/SampleImage2.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage3.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage3.imageset/SampleImage3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage3.imageset/SampleImage3.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage4.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage4.imageset/SampleImage4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage4.imageset/SampleImage4.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage5.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage5.imageset/SampleImage5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage5.imageset/SampleImage5.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage6.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage6.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage6.imageset/SampleImage6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage6.imageset/SampleImage6.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage7.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage7.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage7.imageset/SampleImage7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage7.imageset/SampleImage7.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage8.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage8.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage8.imageset/SampleImage8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage8.imageset/SampleImage8.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage9.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "SampleImage9.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage9.imageset/SampleImage9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/PathDynamicModal/e7dc3c0dcf5e9b8e5f752b9e912a6c8520a6d8ee/PathDynamicModal-Demo/Images.xcassets/Sample/SampleImage9.imageset/SampleImage9.jpg -------------------------------------------------------------------------------- /PathDynamicModal-Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.ryo.$(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 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarHidden 34 | 35 | UIStatusBarStyle 36 | UIStatusBarStyleLightContent 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | 41 | UIViewControllerBasedStatusBarAppearance 42 | 43 | UIViewEdgeAntialiasing 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /PathDynamicModal-Demo/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /PathDynamicModal-Demo/ModalView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ModalView.swift 3 | // PathDynamicModal-Demo 4 | // 5 | // Created by Ryo Aoyama on 2/11/15. 6 | // Copyright (c) 2015 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ModalView: UIView { 12 | var bottomButtonHandler: (() -> Void)? 13 | var closeButtonHandler: (() -> Void)? 14 | 15 | @IBOutlet weak var contentView: UIView! 16 | @IBOutlet private weak var bottomButton: UIButton! 17 | @IBOutlet weak var closeButton: UIButton! 18 | 19 | class func instantiateFromNib() -> ModalView { 20 | let view = UINib(nibName: "ModalView", bundle: nil).instantiateWithOwner(nil, options: nil).first as! ModalView 21 | 22 | return view 23 | } 24 | 25 | override func awakeFromNib() { 26 | super.awakeFromNib() 27 | self.configure() 28 | } 29 | 30 | private func configure() { 31 | self.contentView.layer.cornerRadius = 5.0 32 | self.closeButton.layer.cornerRadius = CGRectGetHeight(self.closeButton.bounds) / 2.0 33 | self.closeButton.layer.shadowColor = UIColor.blackColor().CGColor 34 | self.closeButton.layer.shadowOffset = CGSizeZero 35 | self.closeButton.layer.shadowOpacity = 0.3 36 | self.closeButton.layer.shadowRadius = 2.0 37 | } 38 | 39 | @IBAction func handleBottomButton(sender: UIButton) { 40 | self.bottomButtonHandler?() 41 | } 42 | @IBAction func handleCloseButton(sender: UIButton) { 43 | self.closeButtonHandler?() 44 | } 45 | } -------------------------------------------------------------------------------- /PathDynamicModal-Demo/ModalView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 49 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /PathDynamicModal-Demo/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // PathDynamicModal-Demo 4 | // 5 | // Created by Ryo Aoyama on 2/9/15. 6 | // Copyright (c) 2015 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | @IBOutlet weak var tableView: UITableView! 13 | var titleAndImages: [(String, UIImage)]! = [] 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | self.configure() 18 | } 19 | 20 | private func configure() { 21 | self.navigationController?.navigationBar.titleTextAttributes = [NSFontAttributeName: UIFont.boldSystemFontOfSize(20.0), NSForegroundColorAttributeName: UIColor.whiteColor()] 22 | 23 | self.tableView.registerNib(UINib(nibName: "ImageCell", bundle: nil), forCellReuseIdentifier: "imageCell") 24 | self.tableView.delegate = self 25 | self.tableView.dataSource = self 26 | 27 | self.fillNavigationBar(color: UIColor(red: 252.0/255.0, green: 0, blue: 0, alpha: 1.0)) 28 | 29 | for i in 1...16 { 30 | let imageName = "SampleImage\(i)" 31 | let image = UIImage(named: "\(imageName).jpg")! 32 | self.titleAndImages.append((imageName, image)) 33 | } 34 | } 35 | 36 | private func fillNavigationBar(color color: UIColor) { 37 | if let nav = self.navigationController { 38 | nav.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: .Default) 39 | nav.navigationBar.shadowImage = UIImage() 40 | for view in nav.navigationBar.subviews { 41 | if view.isKindOfClass(NSClassFromString("_UINavigationBarBackground")!) { 42 | if view.isKindOfClass(UIView) { 43 | (view as UIView).backgroundColor = color 44 | } 45 | } 46 | } 47 | } 48 | } 49 | 50 | @IBAction func helloButton(sender: UIButton) { 51 | let view = ModalView.instantiateFromNib() 52 | let window = UIApplication.sharedApplication().delegate?.window! 53 | let modal = PathDynamicModal() 54 | modal.showMagnitude = 200.0 55 | modal.closeMagnitude = 130.0 56 | view.closeButtonHandler = {[weak modal] in 57 | modal?.closeWithLeansRandom() 58 | return 59 | } 60 | view.bottomButtonHandler = {[weak modal] in 61 | modal?.closeWithLeansRandom() 62 | return 63 | } 64 | modal.show(modalView: view, inView: window!) 65 | } 66 | } 67 | 68 | extension ViewController: UITableViewDelegate, UITableViewDataSource { 69 | func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 70 | self.tableView.deselectRowAtIndexPath(indexPath, animated: true) 71 | 72 | let view = ImageModalView.instantiateFromNib() 73 | view.image = self.titleAndImages[indexPath.item].1 74 | let window = UIApplication.sharedApplication().delegate?.window! 75 | let modal = PathDynamicModal.show(modalView: view, inView: window!) 76 | view.closeButtonHandler = {[weak modal] in 77 | modal?.closeWithLeansRandom() 78 | return 79 | } 80 | view.bottomButtonHandler = {[weak modal] in 81 | modal?.closeWithLeansRandom() 82 | return 83 | } 84 | } 85 | 86 | func numberOfSectionsInTableView(tableView: UITableView) -> Int { 87 | return 1 88 | } 89 | 90 | func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { 91 | return 80.0 92 | } 93 | 94 | func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 95 | return self.titleAndImages.count 96 | } 97 | 98 | func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 99 | let cell = self.tableView.dequeueReusableCellWithIdentifier("imageCell", forIndexPath: indexPath) as! ImageCell 100 | let titleAndImage = self.titleAndImages[indexPath.item] 101 | cell.title = titleAndImage.0 102 | cell.sideImage = titleAndImage.1 103 | return cell 104 | } 105 | } -------------------------------------------------------------------------------- /PathDynamicModal-DemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.ryo.$(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 | -------------------------------------------------------------------------------- /PathDynamicModal-DemoTests/PathDynamicModal_DemoTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PathDynamicModal_DemoTests.swift 3 | // PathDynamicModal-DemoTests 4 | // 5 | // Created by Ryo Aoyama on 2/9/15. 6 | // Copyright (c) 2015 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class PathDynamicModal_DemoTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /PathDynamicModal/PathDynamicModal.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PathDynamicModal.swift 3 | // PathDynamicModal-Demo 4 | // 5 | // Created by Ryo Aoyama on 2/9/15. 6 | // Copyright (c) 2015 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class PathDynamicModal: NSObject, UIGestureRecognizerDelegate { 12 | 13 | /* internal properties */ 14 | 15 | var backgroundColor: UIColor = UIColor.blackColor() { 16 | didSet { 17 | self.backgroundView.backgroundColor = backgroundColor.colorWithAlphaComponent(self.backgroundAlpha) 18 | } 19 | } 20 | var backgroundAlpha: CGFloat = 0.7 { 21 | didSet { 22 | self.backgroundView.backgroundColor = self.backgroundColor.colorWithAlphaComponent(backgroundAlpha) 23 | } 24 | } 25 | var showMagnitude: CGFloat = 250.0 26 | var closeMagnitude: CGFloat = 170.0 27 | var closeByTapBackground: Bool = true 28 | var closeBySwipeBackground: Bool = true 29 | var showedHandler: (() -> Void)? 30 | var closedHandler: (() -> Void)? 31 | 32 | /* private properties */ 33 | 34 | private weak var view: UIView! 35 | private var contentView: UIView! = UIView() 36 | private var backgroundView: ModalRetainView! = ModalRetainView() 37 | private var animator: UIDynamicAnimator! 38 | private var push: UIPushBehavior? 39 | private var tap: UITapGestureRecognizer! 40 | private var pan: UIPanGestureRecognizer! 41 | private var originalTranslatesAutoresizingMaskIntoConstraints: Bool! = true 42 | private var originalCenter: CGPoint! = CGPointZero 43 | 44 | /* internal functions */ 45 | 46 | class func show(modalView view: UIView, inView: UIView) -> PathDynamicModal { 47 | let modal = PathDynamicModal() 48 | modal.show(modalView: view, inView: inView) 49 | 50 | return modal 51 | } 52 | 53 | func show(modalView view: UIView, inView: UIView) { 54 | self.view = view 55 | self.backgroundView.modal = self 56 | 57 | self.backgroundView.center = inView.center 58 | self.configureContentView(view: view) 59 | inView.addSubview(self.backgroundView) 60 | 61 | self.fadeBackgroundView(fromAlpha: 0, toAlpha: 1.0, completion: nil) 62 | self.applyShowBehaviors() 63 | } 64 | 65 | func closeWithLeansLeft() { 66 | self.close(horizontalOffset: -2.0) 67 | } 68 | 69 | func closeWithLeansRight() { 70 | self.close(horizontalOffset: 2.0) 71 | } 72 | 73 | func closeWithStraight() { 74 | self.close(horizontalOffset: 0) 75 | } 76 | 77 | func closeWithLeansRandom() { 78 | let rand = (30.0 - CGFloat(arc4random_uniform(60))) / 10.0 79 | self.close(horizontalOffset: rand) 80 | } 81 | 82 | override init() { 83 | super.init() 84 | self.setup() 85 | } 86 | 87 | /* private functions */ 88 | 89 | private func setup() { 90 | self.animator = UIDynamicAnimator(referenceView: self.backgroundView) 91 | 92 | self.tap = UITapGestureRecognizer(target: self, action: "handleBackgroundView:") 93 | self.tap.delegate = self 94 | 95 | self.pan = UIPanGestureRecognizer(target: self, action: "panBackgroundView:") 96 | 97 | self.backgroundView.frame = UIScreen.mainScreen().bounds 98 | self.backgroundView.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.7) 99 | 100 | self.backgroundView.addGestureRecognizer(self.tap) 101 | self.backgroundView.addGestureRecognizer(self.pan) 102 | } 103 | 104 | private func close(horizontalOffset h: CGFloat) { 105 | self.applyCloseBehaviors(horizontalOffset: h) 106 | 107 | self.fadeBackgroundView(fromAlpha: 1.0, toAlpha: 0, completion: { (flag) -> () in 108 | self.backgroundView.removeFromSuperview() 109 | self.backgroundView.modal = nil 110 | 111 | self.view.center = self.originalCenter 112 | self.view.translatesAutoresizingMaskIntoConstraints = self.originalTranslatesAutoresizingMaskIntoConstraints 113 | 114 | self.closedHandler?() 115 | } 116 | ) 117 | } 118 | 119 | private func applyShowBehaviors() { 120 | self.animator.removeAllBehaviors() 121 | 122 | self.push = UIPushBehavior(items: [self.contentView], mode: .Instantaneous) 123 | self.push!.setTargetOffsetFromCenter(UIOffset(horizontal: -1.0, vertical: 0), forItem: self.contentView) 124 | self.push!.pushDirection = CGVectorMake(0, 1.0) 125 | self.push!.magnitude = self.showMagnitude 126 | self.push!.action = {[weak self] in 127 | if let sSelf = self { 128 | if sSelf.contentView.center.y >= sSelf.backgroundView.center.y - 30.0 { 129 | sSelf.fixOnCenter() 130 | } 131 | } 132 | } 133 | 134 | self.animator.addBehavior(self.push!) 135 | } 136 | 137 | private func applyCloseBehaviors(horizontalOffset h: CGFloat) { 138 | self.animator.removeAllBehaviors() 139 | 140 | self.push = UIPushBehavior(items: [self.contentView], mode: .Instantaneous) 141 | self.push!.setTargetOffsetFromCenter(UIOffset(horizontal: h, vertical: 0), forItem: self.contentView) 142 | self.push!.pushDirection = CGVectorMake(0, 1.0) 143 | self.push!.magnitude = self.closeMagnitude 144 | 145 | self.animator.addBehavior(self.push!) 146 | } 147 | 148 | private func fixOnCenter() { 149 | self.animator.removeAllBehaviors() 150 | 151 | UIView.animateWithDuration(0.08, delay: 0, options: .BeginFromCurrentState, animations: { () -> Void in 152 | self.contentView.center.y = self.backgroundView.center.y + 15.0 153 | self.contentView.transform = CGAffineTransformMakeRotation(CGFloat(M_PI / 90.0)) 154 | }, completion: { (flag) -> Void in 155 | UIView.animateWithDuration(0.12, delay: 0, options: [.BeginFromCurrentState, .CurveEaseInOut], animations: { () -> Void in 156 | self.contentView.center = self.backgroundView.center 157 | self.contentView.transform = CGAffineTransformIdentity 158 | }, completion: { (flag) -> Void in 159 | self.showedHandler?() 160 | return 161 | }) 162 | }) 163 | } 164 | 165 | private func configureContentView(view view: UIView) { 166 | self.originalCenter = view.center 167 | self.originalTranslatesAutoresizingMaskIntoConstraints = view.translatesAutoresizingMaskIntoConstraints 168 | view.translatesAutoresizingMaskIntoConstraints = true 169 | 170 | self.contentView.frame = view.bounds 171 | self.contentView.center = self.backgroundView.center 172 | self.contentView.frame.origin.y = -self.contentView.bounds.height 173 | view.frame.origin = CGPointZero 174 | 175 | self.contentView.addSubview(view) 176 | self.backgroundView.addSubview(self.contentView) 177 | } 178 | 179 | private func fadeBackgroundView(fromAlpha fromAlpha: CGFloat, toAlpha: CGFloat, completion: (Bool -> ())?) { 180 | UIView.animateWithDuration(0.4, delay: 0, options: .BeginFromCurrentState, animations: { () -> Void in 181 | self.backgroundView.backgroundColor = self.backgroundColor.colorWithAlphaComponent(self.backgroundAlpha * fromAlpha) 182 | self.backgroundView.backgroundColor = self.backgroundColor.colorWithAlphaComponent(self.backgroundAlpha * toAlpha) 183 | }) { (flag) -> Void in 184 | completion?(flag) 185 | return 186 | } 187 | } 188 | 189 | private func tapPointXPercentage(pointX pointX: CGFloat) -> CGFloat { 190 | /* return |-1 0 1| */ 191 | let width = CGRectGetWidth(self.backgroundView.bounds) 192 | if pointX >= width / 2.0 { 193 | return (2.0 - width / pointX) 194 | }else { 195 | return -(2.0 - width / (width - (pointX + 1))) 196 | } 197 | } 198 | 199 | func handleBackgroundView(sender: UITapGestureRecognizer) { 200 | if self.closeByTapBackground { 201 | let locationX = sender.locationInView(self.backgroundView).x 202 | let offsetH: CGFloat = 3.0 * self.tapPointXPercentage(pointX: locationX) 203 | self.close(horizontalOffset: offsetH) 204 | } 205 | } 206 | 207 | func panBackgroundView(sender: UIPanGestureRecognizer) { 208 | if self.closeBySwipeBackground { 209 | let location = sender.locationInView(self.backgroundView) 210 | let pan = sender.translationInView(self.backgroundView) 211 | let velocityY = sender.velocityInView(self.backgroundView).y 212 | 213 | let isDownGesuture = self.contentView.center.y >= self.backgroundView.center.y 214 | let panYAmountOnBackground = pan.y / CGRectGetHeight(self.backgroundView.bounds) 215 | let angle = (CGFloat(M_PI) / 180.0) * self.tapPointXPercentage(pointX: location.x) * (8.0 * panYAmountOnBackground) 216 | 217 | switch sender.state { 218 | case .Changed: 219 | self.contentView.transform = CGAffineTransformMakeRotation(isDownGesuture ? angle : 0) 220 | self.contentView.center.y = self.backgroundView.center.y + (isDownGesuture ? pan.y : pan.y / 10.0) 221 | self.backgroundView.backgroundColor = self.backgroundColor.colorWithAlphaComponent(self.backgroundAlpha * (isDownGesuture ? 1.0 - panYAmountOnBackground : 1.0)) 222 | case .Cancelled, .Ended: 223 | if self.contentView.center.y >= CGRectGetHeight(self.backgroundView.bounds) 224 | || velocityY >= 200.0 { 225 | self.close(horizontalOffset: 0) 226 | }else { 227 | UIView.animateWithDuration(0.3, delay: 0, options: [.BeginFromCurrentState, .CurveEaseOut], animations: { () -> Void in 228 | self.contentView.transform = CGAffineTransformIdentity 229 | self.contentView.center = self.backgroundView.center 230 | self.backgroundView.backgroundColor = self.backgroundColor.colorWithAlphaComponent(self.backgroundAlpha) 231 | }, completion: nil) 232 | } 233 | default: 234 | break 235 | } 236 | } 237 | } 238 | 239 | /* delegate functions */ 240 | 241 | func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldReceiveTouch touch: UITouch) -> Bool { 242 | return gestureRecognizer.view == touch.view ? true : false 243 | } 244 | } 245 | 246 | private class ModalRetainView: UIView { 247 | private var modal: PathDynamicModal? 248 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PathDynamicModal 2 | ======================= 3 | 4 | #### A modal view using UIDynamicAnimator, like the Path for iOS. 5 | 6 | 7 | ## Screen shots 8 | ![screen shot1](https://github.com/ra1028/PathDynamicModal/raw/master/Assets/screen_shot1.png) 9 | ![screen shot2](https://github.com/ra1028/PathDynamicModal/raw/master/Assets/screen_shot2.png) 10 | 11 | 12 | ## Animation 13 | ![animated gif](https://github.com/ra1028/PathDynamicModal/raw/master/Assets/animation.gif) 14 | 15 | 16 | ## Explanation 17 | This is the library that present modal with dynamic animation. 18 | Slant of dismiss modal by tap background is depend on tap horizontal position. 19 | Also, slant of swiping modal is depend on touch horizontal position and amount of swipe down. 20 | If you want to change the modal dropping speed, please set the property showMagnitude or closeMagnitude. 21 | By all means, use the Demo-project. 22 | 23 | 24 | ## Installation 25 | Simply copy & paste PathDynamicModal.swift into your project. 26 | Or, use the git-submodule, please. 27 | git submodule add https://github.com/ra1028/PathDynamicModal PathDynamicModal 28 | Cocoapods has not yet supported. 29 | 30 | 31 | ## Usage 32 | 1. Create a instance of any UIView subclass. 33 | 2. Call the show(modalView: , inView: ) of PathDynamicModal class-function or instance-function. 34 | 3. For detail, please refer to Demo-project. 35 | 36 | 37 | ## Functions 38 | ``` 39 | class func show(modalView view: UIView, inView: UIView) -> PathDynamicModal // Show modal with settings default all. 40 | func show(modalView view: UIView, inView: UIView) // Show modal with custom settings. 41 | func closeWithLeansRandom() // Close modal with random slant. 42 | func closeWithStraight() // Close modal with non slant. 43 | func closeWithLeansRight() // Close modal with right slant. 44 | func closeWithLeansLeft() Close modal with left slant. 45 | ``` 46 | 47 | 48 | ## Property 49 | ``` 50 | var backgroundColor: UIColor // Default is UIColor.blackColor() 51 | var backgroundAlpha: CGFloat // Default is 0.7 52 | var showMagnitude: CGFloat // Default is 250.0. This affects the speed of modal dropping to show. 53 | var closeMagnitude: CGFloat // Default is 170.0. This affects the speed of modal dropping to close. 54 | var closeByTapBackground: Bool // Default is true 55 | var closeBySwipeBackground: Bool // Default is true 56 | var showedHandler: (() -> Void)? 57 | var closedHandler: (() -> Void)? 58 | ``` 59 | 60 | 61 | ## License 62 | PathDynamicModal is available under the MIT license. See the LICENSE file for more info. --------------------------------------------------------------------------------