├── .gitignore ├── .travis.yml ├── Example ├── .swiftlint.yml ├── Podfile ├── Podfile.lock ├── SideNavigation.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── SideNavigation-Example.xcscheme ├── SideNavigation.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── SideNavigation │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── LeftViewController.swift │ ├── RightViewController.swift │ └── ViewController.swift └── Tests │ ├── Info.plist │ └── Tests.swift ├── LICENSE ├── README.md ├── SideNavigation-Objective-C ├── Podfile ├── Podfile.lock ├── SideNavigation-Objective-C.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── SideNavigation-Objective-C │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── LeftViewController.h │ ├── LeftViewController.m │ ├── RightViewController.h │ ├── RightViewController.m │ ├── TestViewController.h │ ├── TestViewController.m │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── SideNavigation.podspec ├── SideNavigation ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── AnimatedTransitioning.swift │ ├── PercentDrivenInteractiveTransition.swift │ ├── PresentationController.swift │ └── SideMenuManager.swift ├── _Pods.xcodeproj └── issue_template.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | .build/ 41 | 42 | # CocoaPods 43 | # 44 | # We recommend against adding the Pods directory to your .gitignore. However 45 | # you should judge for yourself, the pros and cons are mentioned at: 46 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 47 | # 48 | Pods/ 49 | 50 | # Carthage 51 | # 52 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 53 | # Carthage/Checkouts 54 | 55 | Carthage/Build 56 | 57 | # fastlane 58 | # 59 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 60 | # screenshots whenever they are needed. 61 | # For more information about the recommended setup visit: 62 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 63 | 64 | fastlane/report.xml 65 | fastlane/Preview.html 66 | fastlane/screenshots 67 | fastlane/test_output 68 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | -------------------------------------------------------------------------------- /Example/.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: # rule identifiers to exclude from running 2 | - colon 3 | - comma 4 | - control_statement 5 | - weak_delegate 6 | opt_in_rules: # some rules are only opt-in 7 | - empty_count 8 | # Find all the available rules by running: 9 | # swiftlint rules 10 | included: # paths to include during linting. `--path` is ignored if present. 11 | - ../ 12 | excluded: # paths to ignore during linting. Takes precedence over `included`. 13 | - Carthage 14 | - Pods 15 | - Source/ExcludedFolder 16 | - Source/ExcludedFile.swift 17 | - third_party 18 | - catalog/third_party 19 | 20 | # configurable rules can be customized from this configuration file 21 | # binary rules can set their severity level 22 | force_cast: warning # implicitly 23 | force_try: 24 | severity: warning # explicitly 25 | # rules that have both warning and error levels, can set just the warning level 26 | # implicitly 27 | line_length: 180 28 | # they can set both implicitly with an array 29 | type_body_length: 30 | - 300 # warning 31 | - 400 # error 32 | # or they can set both explicitly 33 | file_length: 34 | warning: 500 35 | error: 1200 36 | # naming rules can set warnings/errors for min_length and max_length 37 | # additionally they can set excluded names 38 | type_name: 39 | min_length: 1 # only warning 40 | max_length: # warning and error 41 | warning: 40 42 | error: 50 43 | excluded: iPhone # excluded via string 44 | identifier_name: 45 | min_length: # only min_length 46 | error: 1 # only error 47 | excluded: # excluded via string array 48 | - id 49 | - URL 50 | - GlobalAPIKey 51 | reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji) 52 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'SideNavigation_Example' do 4 | pod 'SideNavigation', :path => '../' 5 | pod 'SnapKit' 6 | 7 | target 'SideNavigation_Tests' do 8 | inherit! :search_paths 9 | 10 | 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SideNavigation (1.1.3) 3 | - SnapKit (4.0.0) 4 | 5 | DEPENDENCIES: 6 | - SideNavigation (from `../`) 7 | - SnapKit 8 | 9 | SPEC REPOS: 10 | trunk: 11 | - SnapKit 12 | 13 | EXTERNAL SOURCES: 14 | SideNavigation: 15 | :path: "../" 16 | 17 | SPEC CHECKSUMS: 18 | SideNavigation: 1e49786ae0bd4aa613e905dd52413e2d0091d2d9 19 | SnapKit: a42d492c16e80209130a3379f73596c3454b7694 20 | 21 | PODFILE CHECKSUM: 9ccb616fcc8c827bdf59feb9292c267ca6fbcde0 22 | 23 | COCOAPODS: 1.9.1 24 | -------------------------------------------------------------------------------- /Example/SideNavigation.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 448BAF798497EFA07278D1E2 /* Pods_SideNavigation_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F03EA4A0867D9D9E11C578B9 /* Pods_SideNavigation_Tests.framework */; }; 11 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 12 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 13 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 14 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 15 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; 16 | 75D7415B0C2E54E9DEE4D10C /* Pods_SideNavigation_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 643FA184426270ADB64B5D2A /* Pods_SideNavigation_Example.framework */; }; 17 | AACEFFCB1F31B8B1000DB41E /* LeftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AACEFFC91F31B8B1000DB41E /* LeftViewController.swift */; }; 18 | AACEFFCC1F31B8B1000DB41E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AACEFFCA1F31B8B1000DB41E /* ViewController.swift */; }; 19 | AACEFFCE1F31B954000DB41E /* RightViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AACEFFCD1F31B954000DB41E /* RightViewController.swift */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = 607FACCF1AFB9204008FA782; 28 | remoteInfo = SideNavigation; 29 | }; 30 | /* End PBXContainerItemProxy section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 081D056CE4F8BDE1A4D1FE16 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 34 | 396EF163472C49DB3C652B6E /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 35 | 560C7E285395390DE8BBB80F /* Pods-SideNavigation_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SideNavigation_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SideNavigation_Example/Pods-SideNavigation_Example.debug.xcconfig"; sourceTree = ""; }; 36 | 607FACD01AFB9204008FA782 /* SideNavigation_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SideNavigation_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39 | 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 40 | 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 41 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 42 | 607FACE51AFB9204008FA782 /* SideNavigation_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SideNavigation_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; 45 | 643FA184426270ADB64B5D2A /* Pods_SideNavigation_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SideNavigation_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 64BD441FE0DB7B0E96A61954 /* SideNavigation.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SideNavigation.podspec; path = ../SideNavigation.podspec; sourceTree = ""; }; 47 | A5AA5B3905617346F9C36EAF /* Pods-SideNavigation_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SideNavigation_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SideNavigation_Example/Pods-SideNavigation_Example.release.xcconfig"; sourceTree = ""; }; 48 | AACEFFC91F31B8B1000DB41E /* LeftViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LeftViewController.swift; sourceTree = ""; }; 49 | AACEFFCA1F31B8B1000DB41E /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 50 | AACEFFCD1F31B954000DB41E /* RightViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RightViewController.swift; sourceTree = ""; }; 51 | D2EB3405D08B929B948A5F0B /* Pods-SideNavigation_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SideNavigation_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SideNavigation_Tests/Pods-SideNavigation_Tests.release.xcconfig"; sourceTree = ""; }; 52 | DF5B0480061B6E648577CC60 /* Pods-SideNavigation_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SideNavigation_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SideNavigation_Tests/Pods-SideNavigation_Tests.debug.xcconfig"; sourceTree = ""; }; 53 | F03EA4A0867D9D9E11C578B9 /* Pods_SideNavigation_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SideNavigation_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | 607FACCD1AFB9204008FA782 /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | 75D7415B0C2E54E9DEE4D10C /* Pods_SideNavigation_Example.framework in Frameworks */, 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | 607FACE21AFB9204008FA782 /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | 448BAF798497EFA07278D1E2 /* Pods_SideNavigation_Tests.framework in Frameworks */, 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | /* End PBXFrameworksBuildPhase section */ 74 | 75 | /* Begin PBXGroup section */ 76 | 0F77EE8D5C59D668F7DBDE02 /* Pods */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 560C7E285395390DE8BBB80F /* Pods-SideNavigation_Example.debug.xcconfig */, 80 | A5AA5B3905617346F9C36EAF /* Pods-SideNavigation_Example.release.xcconfig */, 81 | DF5B0480061B6E648577CC60 /* Pods-SideNavigation_Tests.debug.xcconfig */, 82 | D2EB3405D08B929B948A5F0B /* Pods-SideNavigation_Tests.release.xcconfig */, 83 | ); 84 | name = Pods; 85 | sourceTree = ""; 86 | }; 87 | 607FACC71AFB9204008FA782 = { 88 | isa = PBXGroup; 89 | children = ( 90 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 91 | 607FACD21AFB9204008FA782 /* Example for SideNavigation */, 92 | 607FACE81AFB9204008FA782 /* Tests */, 93 | 607FACD11AFB9204008FA782 /* Products */, 94 | 0F77EE8D5C59D668F7DBDE02 /* Pods */, 95 | 6330A6D55B0B45E113C1BED6 /* Frameworks */, 96 | ); 97 | sourceTree = ""; 98 | }; 99 | 607FACD11AFB9204008FA782 /* Products */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 607FACD01AFB9204008FA782 /* SideNavigation_Example.app */, 103 | 607FACE51AFB9204008FA782 /* SideNavigation_Tests.xctest */, 104 | ); 105 | name = Products; 106 | sourceTree = ""; 107 | }; 108 | 607FACD21AFB9204008FA782 /* Example for SideNavigation */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | AACEFFC91F31B8B1000DB41E /* LeftViewController.swift */, 112 | AACEFFCD1F31B954000DB41E /* RightViewController.swift */, 113 | AACEFFCA1F31B8B1000DB41E /* ViewController.swift */, 114 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 115 | 607FACD91AFB9204008FA782 /* Main.storyboard */, 116 | 607FACDC1AFB9204008FA782 /* Images.xcassets */, 117 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 118 | 607FACD31AFB9204008FA782 /* Supporting Files */, 119 | ); 120 | name = "Example for SideNavigation"; 121 | path = SideNavigation; 122 | sourceTree = ""; 123 | }; 124 | 607FACD31AFB9204008FA782 /* Supporting Files */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 607FACD41AFB9204008FA782 /* Info.plist */, 128 | ); 129 | name = "Supporting Files"; 130 | sourceTree = ""; 131 | }; 132 | 607FACE81AFB9204008FA782 /* Tests */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 607FACEB1AFB9204008FA782 /* Tests.swift */, 136 | 607FACE91AFB9204008FA782 /* Supporting Files */, 137 | ); 138 | path = Tests; 139 | sourceTree = ""; 140 | }; 141 | 607FACE91AFB9204008FA782 /* Supporting Files */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 607FACEA1AFB9204008FA782 /* Info.plist */, 145 | ); 146 | name = "Supporting Files"; 147 | sourceTree = ""; 148 | }; 149 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 64BD441FE0DB7B0E96A61954 /* SideNavigation.podspec */, 153 | 396EF163472C49DB3C652B6E /* README.md */, 154 | 081D056CE4F8BDE1A4D1FE16 /* LICENSE */, 155 | ); 156 | name = "Podspec Metadata"; 157 | sourceTree = ""; 158 | }; 159 | 6330A6D55B0B45E113C1BED6 /* Frameworks */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 643FA184426270ADB64B5D2A /* Pods_SideNavigation_Example.framework */, 163 | F03EA4A0867D9D9E11C578B9 /* Pods_SideNavigation_Tests.framework */, 164 | ); 165 | name = Frameworks; 166 | sourceTree = ""; 167 | }; 168 | /* End PBXGroup section */ 169 | 170 | /* Begin PBXNativeTarget section */ 171 | 607FACCF1AFB9204008FA782 /* SideNavigation_Example */ = { 172 | isa = PBXNativeTarget; 173 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SideNavigation_Example" */; 174 | buildPhases = ( 175 | 64CE6ABEB91FDA815A7A8826 /* [CP] Check Pods Manifest.lock */, 176 | 607FACCC1AFB9204008FA782 /* Sources */, 177 | 607FACCD1AFB9204008FA782 /* Frameworks */, 178 | 607FACCE1AFB9204008FA782 /* Resources */, 179 | 7CBD469E0086C13AD130E3CE /* [CP] Embed Pods Frameworks */, 180 | ); 181 | buildRules = ( 182 | ); 183 | dependencies = ( 184 | ); 185 | name = SideNavigation_Example; 186 | productName = SideNavigation; 187 | productReference = 607FACD01AFB9204008FA782 /* SideNavigation_Example.app */; 188 | productType = "com.apple.product-type.application"; 189 | }; 190 | 607FACE41AFB9204008FA782 /* SideNavigation_Tests */ = { 191 | isa = PBXNativeTarget; 192 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SideNavigation_Tests" */; 193 | buildPhases = ( 194 | 70049774061F4F82DDD3671B /* [CP] Check Pods Manifest.lock */, 195 | 607FACE11AFB9204008FA782 /* Sources */, 196 | 607FACE21AFB9204008FA782 /* Frameworks */, 197 | 607FACE31AFB9204008FA782 /* Resources */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */, 203 | ); 204 | name = SideNavigation_Tests; 205 | productName = Tests; 206 | productReference = 607FACE51AFB9204008FA782 /* SideNavigation_Tests.xctest */; 207 | productType = "com.apple.product-type.bundle.unit-test"; 208 | }; 209 | /* End PBXNativeTarget section */ 210 | 211 | /* Begin PBXProject section */ 212 | 607FACC81AFB9204008FA782 /* Project object */ = { 213 | isa = PBXProject; 214 | attributes = { 215 | LastSwiftUpdateCheck = 0720; 216 | LastUpgradeCheck = 1220; 217 | ORGANIZATIONNAME = CocoaPods; 218 | TargetAttributes = { 219 | 607FACCF1AFB9204008FA782 = { 220 | CreatedOnToolsVersion = 6.3.1; 221 | DevelopmentTeam = GTVM2F95ZD; 222 | LastSwiftMigration = 1220; 223 | }; 224 | 607FACE41AFB9204008FA782 = { 225 | CreatedOnToolsVersion = 6.3.1; 226 | DevelopmentTeam = GTVM2F95ZD; 227 | LastSwiftMigration = 1220; 228 | TestTargetID = 607FACCF1AFB9204008FA782; 229 | }; 230 | }; 231 | }; 232 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "SideNavigation" */; 233 | compatibilityVersion = "Xcode 3.2"; 234 | developmentRegion = English; 235 | hasScannedForEncodings = 0; 236 | knownRegions = ( 237 | English, 238 | en, 239 | Base, 240 | ); 241 | mainGroup = 607FACC71AFB9204008FA782; 242 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 243 | projectDirPath = ""; 244 | projectRoot = ""; 245 | targets = ( 246 | 607FACCF1AFB9204008FA782 /* SideNavigation_Example */, 247 | 607FACE41AFB9204008FA782 /* SideNavigation_Tests */, 248 | ); 249 | }; 250 | /* End PBXProject section */ 251 | 252 | /* Begin PBXResourcesBuildPhase section */ 253 | 607FACCE1AFB9204008FA782 /* Resources */ = { 254 | isa = PBXResourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 258 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 259 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, 260 | ); 261 | runOnlyForDeploymentPostprocessing = 0; 262 | }; 263 | 607FACE31AFB9204008FA782 /* Resources */ = { 264 | isa = PBXResourcesBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | /* End PBXResourcesBuildPhase section */ 271 | 272 | /* Begin PBXShellScriptBuildPhase section */ 273 | 64CE6ABEB91FDA815A7A8826 /* [CP] Check Pods Manifest.lock */ = { 274 | isa = PBXShellScriptBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | ); 278 | inputPaths = ( 279 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 280 | "${PODS_ROOT}/Manifest.lock", 281 | ); 282 | name = "[CP] Check Pods Manifest.lock"; 283 | outputPaths = ( 284 | "$(DERIVED_FILE_DIR)/Pods-SideNavigation_Example-checkManifestLockResult.txt", 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | shellPath = /bin/sh; 288 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 289 | showEnvVarsInLog = 0; 290 | }; 291 | 70049774061F4F82DDD3671B /* [CP] Check Pods Manifest.lock */ = { 292 | isa = PBXShellScriptBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | ); 296 | inputPaths = ( 297 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 298 | "${PODS_ROOT}/Manifest.lock", 299 | ); 300 | name = "[CP] Check Pods Manifest.lock"; 301 | outputPaths = ( 302 | "$(DERIVED_FILE_DIR)/Pods-SideNavigation_Tests-checkManifestLockResult.txt", 303 | ); 304 | runOnlyForDeploymentPostprocessing = 0; 305 | shellPath = /bin/sh; 306 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 307 | showEnvVarsInLog = 0; 308 | }; 309 | 7CBD469E0086C13AD130E3CE /* [CP] Embed Pods Frameworks */ = { 310 | isa = PBXShellScriptBuildPhase; 311 | buildActionMask = 2147483647; 312 | files = ( 313 | ); 314 | inputPaths = ( 315 | "${PODS_ROOT}/Target Support Files/Pods-SideNavigation_Example/Pods-SideNavigation_Example-frameworks.sh", 316 | "${BUILT_PRODUCTS_DIR}/SideNavigation/SideNavigation.framework", 317 | "${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework", 318 | ); 319 | name = "[CP] Embed Pods Frameworks"; 320 | outputPaths = ( 321 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SideNavigation.framework", 322 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework", 323 | ); 324 | runOnlyForDeploymentPostprocessing = 0; 325 | shellPath = /bin/sh; 326 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SideNavigation_Example/Pods-SideNavigation_Example-frameworks.sh\"\n"; 327 | showEnvVarsInLog = 0; 328 | }; 329 | /* End PBXShellScriptBuildPhase section */ 330 | 331 | /* Begin PBXSourcesBuildPhase section */ 332 | 607FACCC1AFB9204008FA782 /* Sources */ = { 333 | isa = PBXSourcesBuildPhase; 334 | buildActionMask = 2147483647; 335 | files = ( 336 | AACEFFCC1F31B8B1000DB41E /* ViewController.swift in Sources */, 337 | AACEFFCE1F31B954000DB41E /* RightViewController.swift in Sources */, 338 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 339 | AACEFFCB1F31B8B1000DB41E /* LeftViewController.swift in Sources */, 340 | ); 341 | runOnlyForDeploymentPostprocessing = 0; 342 | }; 343 | 607FACE11AFB9204008FA782 /* Sources */ = { 344 | isa = PBXSourcesBuildPhase; 345 | buildActionMask = 2147483647; 346 | files = ( 347 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */, 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | }; 351 | /* End PBXSourcesBuildPhase section */ 352 | 353 | /* Begin PBXTargetDependency section */ 354 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { 355 | isa = PBXTargetDependency; 356 | target = 607FACCF1AFB9204008FA782 /* SideNavigation_Example */; 357 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; 358 | }; 359 | /* End PBXTargetDependency section */ 360 | 361 | /* Begin PBXVariantGroup section */ 362 | 607FACD91AFB9204008FA782 /* Main.storyboard */ = { 363 | isa = PBXVariantGroup; 364 | children = ( 365 | 607FACDA1AFB9204008FA782 /* Base */, 366 | ); 367 | name = Main.storyboard; 368 | sourceTree = ""; 369 | }; 370 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { 371 | isa = PBXVariantGroup; 372 | children = ( 373 | 607FACDF1AFB9204008FA782 /* Base */, 374 | ); 375 | name = LaunchScreen.xib; 376 | sourceTree = ""; 377 | }; 378 | /* End PBXVariantGroup section */ 379 | 380 | /* Begin XCBuildConfiguration section */ 381 | 607FACED1AFB9204008FA782 /* Debug */ = { 382 | isa = XCBuildConfiguration; 383 | buildSettings = { 384 | ALWAYS_SEARCH_USER_PATHS = NO; 385 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 386 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 387 | CLANG_CXX_LIBRARY = "libc++"; 388 | CLANG_ENABLE_MODULES = YES; 389 | CLANG_ENABLE_OBJC_ARC = YES; 390 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 391 | CLANG_WARN_BOOL_CONVERSION = YES; 392 | CLANG_WARN_COMMA = YES; 393 | CLANG_WARN_CONSTANT_CONVERSION = YES; 394 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 395 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 396 | CLANG_WARN_EMPTY_BODY = YES; 397 | CLANG_WARN_ENUM_CONVERSION = YES; 398 | CLANG_WARN_INFINITE_RECURSION = YES; 399 | CLANG_WARN_INT_CONVERSION = YES; 400 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 401 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 402 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 403 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 404 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 405 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 406 | CLANG_WARN_STRICT_PROTOTYPES = YES; 407 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 408 | CLANG_WARN_UNREACHABLE_CODE = YES; 409 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 410 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 411 | COPY_PHASE_STRIP = NO; 412 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 413 | ENABLE_STRICT_OBJC_MSGSEND = YES; 414 | ENABLE_TESTABILITY = YES; 415 | GCC_C_LANGUAGE_STANDARD = gnu99; 416 | GCC_DYNAMIC_NO_PIC = NO; 417 | GCC_NO_COMMON_BLOCKS = YES; 418 | GCC_OPTIMIZATION_LEVEL = 0; 419 | GCC_PREPROCESSOR_DEFINITIONS = ( 420 | "DEBUG=1", 421 | "$(inherited)", 422 | ); 423 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 426 | GCC_WARN_UNDECLARED_SELECTOR = YES; 427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 428 | GCC_WARN_UNUSED_FUNCTION = YES; 429 | GCC_WARN_UNUSED_VARIABLE = YES; 430 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 431 | MTL_ENABLE_DEBUG_INFO = YES; 432 | ONLY_ACTIVE_ARCH = YES; 433 | SDKROOT = iphoneos; 434 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 435 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 436 | SWIFT_VERSION = 5.0; 437 | }; 438 | name = Debug; 439 | }; 440 | 607FACEE1AFB9204008FA782 /* Release */ = { 441 | isa = XCBuildConfiguration; 442 | buildSettings = { 443 | ALWAYS_SEARCH_USER_PATHS = NO; 444 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 445 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 446 | CLANG_CXX_LIBRARY = "libc++"; 447 | CLANG_ENABLE_MODULES = YES; 448 | CLANG_ENABLE_OBJC_ARC = YES; 449 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 450 | CLANG_WARN_BOOL_CONVERSION = YES; 451 | CLANG_WARN_COMMA = YES; 452 | CLANG_WARN_CONSTANT_CONVERSION = YES; 453 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 454 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 455 | CLANG_WARN_EMPTY_BODY = YES; 456 | CLANG_WARN_ENUM_CONVERSION = YES; 457 | CLANG_WARN_INFINITE_RECURSION = YES; 458 | CLANG_WARN_INT_CONVERSION = YES; 459 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 460 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 461 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 462 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 463 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 464 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 465 | CLANG_WARN_STRICT_PROTOTYPES = YES; 466 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 467 | CLANG_WARN_UNREACHABLE_CODE = YES; 468 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 469 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 470 | COPY_PHASE_STRIP = NO; 471 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 472 | ENABLE_NS_ASSERTIONS = NO; 473 | ENABLE_STRICT_OBJC_MSGSEND = YES; 474 | GCC_C_LANGUAGE_STANDARD = gnu99; 475 | GCC_NO_COMMON_BLOCKS = YES; 476 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 477 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 478 | GCC_WARN_UNDECLARED_SELECTOR = YES; 479 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 480 | GCC_WARN_UNUSED_FUNCTION = YES; 481 | GCC_WARN_UNUSED_VARIABLE = YES; 482 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 483 | MTL_ENABLE_DEBUG_INFO = NO; 484 | SDKROOT = iphoneos; 485 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 486 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 487 | SWIFT_VERSION = 5.0; 488 | VALIDATE_PRODUCT = YES; 489 | }; 490 | name = Release; 491 | }; 492 | 607FACF01AFB9204008FA782 /* Debug */ = { 493 | isa = XCBuildConfiguration; 494 | baseConfigurationReference = 560C7E285395390DE8BBB80F /* Pods-SideNavigation_Example.debug.xcconfig */; 495 | buildSettings = { 496 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 497 | DEVELOPMENT_TEAM = GTVM2F95ZD; 498 | INFOPLIST_FILE = SideNavigation/Info.plist; 499 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 500 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 501 | MODULE_NAME = ExampleApp; 502 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.SideNavigation-Example"; 503 | PRODUCT_NAME = "$(TARGET_NAME)"; 504 | SWIFT_VERSION = 5.0; 505 | }; 506 | name = Debug; 507 | }; 508 | 607FACF11AFB9204008FA782 /* Release */ = { 509 | isa = XCBuildConfiguration; 510 | baseConfigurationReference = A5AA5B3905617346F9C36EAF /* Pods-SideNavigation_Example.release.xcconfig */; 511 | buildSettings = { 512 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 513 | DEVELOPMENT_TEAM = GTVM2F95ZD; 514 | INFOPLIST_FILE = SideNavigation/Info.plist; 515 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 516 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 517 | MODULE_NAME = ExampleApp; 518 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.SideNavigation-Example"; 519 | PRODUCT_NAME = "$(TARGET_NAME)"; 520 | SWIFT_VERSION = 5.0; 521 | }; 522 | name = Release; 523 | }; 524 | 607FACF31AFB9204008FA782 /* Debug */ = { 525 | isa = XCBuildConfiguration; 526 | baseConfigurationReference = DF5B0480061B6E648577CC60 /* Pods-SideNavigation_Tests.debug.xcconfig */; 527 | buildSettings = { 528 | DEVELOPMENT_TEAM = GTVM2F95ZD; 529 | FRAMEWORK_SEARCH_PATHS = ( 530 | "$(SDKROOT)/Developer/Library/Frameworks", 531 | "$(inherited)", 532 | ); 533 | GCC_PREPROCESSOR_DEFINITIONS = ( 534 | "DEBUG=1", 535 | "$(inherited)", 536 | ); 537 | INFOPLIST_FILE = Tests/Info.plist; 538 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 539 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 540 | PRODUCT_NAME = "$(TARGET_NAME)"; 541 | SWIFT_VERSION = 5.0; 542 | }; 543 | name = Debug; 544 | }; 545 | 607FACF41AFB9204008FA782 /* Release */ = { 546 | isa = XCBuildConfiguration; 547 | baseConfigurationReference = D2EB3405D08B929B948A5F0B /* Pods-SideNavigation_Tests.release.xcconfig */; 548 | buildSettings = { 549 | DEVELOPMENT_TEAM = GTVM2F95ZD; 550 | FRAMEWORK_SEARCH_PATHS = ( 551 | "$(SDKROOT)/Developer/Library/Frameworks", 552 | "$(inherited)", 553 | ); 554 | INFOPLIST_FILE = Tests/Info.plist; 555 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 556 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 557 | PRODUCT_NAME = "$(TARGET_NAME)"; 558 | SWIFT_VERSION = 5.0; 559 | }; 560 | name = Release; 561 | }; 562 | /* End XCBuildConfiguration section */ 563 | 564 | /* Begin XCConfigurationList section */ 565 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "SideNavigation" */ = { 566 | isa = XCConfigurationList; 567 | buildConfigurations = ( 568 | 607FACED1AFB9204008FA782 /* Debug */, 569 | 607FACEE1AFB9204008FA782 /* Release */, 570 | ); 571 | defaultConfigurationIsVisible = 0; 572 | defaultConfigurationName = Release; 573 | }; 574 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SideNavigation_Example" */ = { 575 | isa = XCConfigurationList; 576 | buildConfigurations = ( 577 | 607FACF01AFB9204008FA782 /* Debug */, 578 | 607FACF11AFB9204008FA782 /* Release */, 579 | ); 580 | defaultConfigurationIsVisible = 0; 581 | defaultConfigurationName = Release; 582 | }; 583 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SideNavigation_Tests" */ = { 584 | isa = XCConfigurationList; 585 | buildConfigurations = ( 586 | 607FACF31AFB9204008FA782 /* Debug */, 587 | 607FACF41AFB9204008FA782 /* Release */, 588 | ); 589 | defaultConfigurationIsVisible = 0; 590 | defaultConfigurationName = Release; 591 | }; 592 | /* End XCConfigurationList section */ 593 | }; 594 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 595 | } 596 | -------------------------------------------------------------------------------- /Example/SideNavigation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/SideNavigation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/SideNavigation.xcodeproj/xcshareddata/xcschemes/SideNavigation-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 51 | 52 | 53 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 76 | 78 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /Example/SideNavigation.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/SideNavigation.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/SideNavigation/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SideNavigation 4 | // 5 | // Created by wangchengqvan@gmail.com on 08/02/2017. 6 | // Copyright (c) 2017 wangchengqvan@gmail.com. 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: [UIApplication.LaunchOptionsKey: Any]?) -> 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 | -------------------------------------------------------------------------------- /Example/SideNavigation/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/SideNavigation/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example/SideNavigation/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 | } 39 | -------------------------------------------------------------------------------- /Example/SideNavigation/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/SideNavigation/LeftViewController.swift: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // LeftViewController.swift 4 | // Slide 5 | // 6 | // Created by Steve on 2017/8/1. 7 | // Copyright © 2017年 Jack. All rights reserved. 8 | // 9 | 10 | import UIKit 11 | 12 | class LeftViewController: UIViewController { 13 | var tableView: UITableView! 14 | var items = ["1", "2", "3"] 15 | var didselected: ((IndexPath) -> ())? 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | view.backgroundColor = .brown 20 | tableView = UITableView() 21 | tableView.backgroundColor = .purple 22 | if #available(iOS 11, *) { 23 | tableView.contentInsetAdjustmentBehavior = .never 24 | } 25 | tableView.delegate = self 26 | tableView.dataSource = self 27 | tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") 28 | view.addSubview(tableView) 29 | tableView.snp.makeConstraints { (make) in 30 | make.edges.equalTo(self.view) 31 | } 32 | let headerView = UIView(frame: .zero) 33 | headerView.backgroundColor = .blue 34 | tableView.tableHeaderView = headerView 35 | headerView.snp.makeConstraints { (make) in 36 | make.top.equalTo(tableView.snp.top) 37 | make.width.equalTo(tableView.snp.width) 38 | make.height.equalTo(180) 39 | } 40 | headerView.superview?.layoutIfNeeded() 41 | } 42 | 43 | func startdismiss() { 44 | self.dismiss(animated: false, completion: nil) 45 | } 46 | } 47 | 48 | extension LeftViewController: UITableViewDelegate, UITableViewDataSource { 49 | 50 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 51 | return items.count 52 | } 53 | 54 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 55 | let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) 56 | cell.textLabel?.text = items[indexPath.row] 57 | return cell 58 | } 59 | 60 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 61 | self.didselected?(indexPath) 62 | self.dismiss(animated: true, completion: nil) 63 | } 64 | } 65 | 66 | 67 | -------------------------------------------------------------------------------- /Example/SideNavigation/RightViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RightViewController.swift 3 | // Slide 4 | // 5 | // Created by Steve on 2017/8/1. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SnapKit 11 | 12 | class RightViewController: UIViewController { 13 | var tableView: UITableView! 14 | var items = ["1", "2", "3"] 15 | var didselected: ((IndexPath) -> ())? 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | view.backgroundColor = .yellow 20 | tableView = UITableView() 21 | tableView.delegate = self 22 | tableView.dataSource = self 23 | tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") 24 | view.addSubview(tableView) 25 | tableView.snp.makeConstraints { (make) in 26 | make.edges.equalTo(self.view) 27 | } 28 | let headerView = UIView(frame: CGRect(origin: .zero, size: CGSize(width: 0, height: 180))) 29 | headerView.backgroundColor = .blue 30 | tableView.tableHeaderView = headerView 31 | } 32 | 33 | func startdismiss() { 34 | self.dismiss(animated: true, completion: nil) 35 | } 36 | } 37 | 38 | extension RightViewController: UITableViewDelegate, UITableViewDataSource { 39 | 40 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 41 | return items.count 42 | } 43 | 44 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 45 | let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) 46 | cell.textLabel?.text = items[indexPath.row] 47 | return cell 48 | } 49 | 50 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 51 | self.didselected?(indexPath) 52 | self.dismiss(animated: true, completion: nil) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Example/SideNavigation/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Slide 4 | // 5 | // Created by Steve on 2017/8/1. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SideNavigation 11 | 12 | class ViewController: UIViewController { 13 | 14 | var leftViewController: LeftViewController! { 15 | didSet { 16 | self.slideMenuManager1 = SideMenuManager(self, left: self.leftViewController) 17 | self.slideMenuManager1.sideScale = 1.0 / 2.0 18 | self.slideMenuManager1.animationDuration = TimeInterval(1.0) 19 | } 20 | } 21 | var rightViewController: RightViewController! { 22 | didSet { 23 | self.slideMenuManager2 = SideMenuManager(self, right: self.rightViewController) 24 | self.slideMenuManager2.sideScale = 1.0 / 2.0 25 | } 26 | } 27 | var slideMenuManager1: SideMenuManager! 28 | var slideMenuManager2: SideMenuManager! 29 | 30 | override func viewDidLoad() { 31 | super.viewDidLoad() 32 | self.view.backgroundColor = .red 33 | self.leftViewController = LeftViewController() 34 | self.leftViewController.didselected = { [weak self] (indexPath) in 35 | let dest = UIViewController() 36 | dest.view.backgroundColor = .blue 37 | self?.navigationController?.pushViewController(dest, animated: false) 38 | } 39 | self.rightViewController = RightViewController() 40 | } 41 | 42 | override func viewWillAppear(_ animated: Bool) { 43 | super.viewWillAppear(animated) 44 | self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "left", style: .plain, target: self, action: #selector(leftClick)) 45 | self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "right", style: .plain, target: self, action: #selector(rightClick)) 46 | } 47 | 48 | @objc func leftClick() { 49 | self.present(self.leftViewController, animated: true, completion: nil) 50 | } 51 | 52 | @objc func rightClick() { 53 | self.present(self.rightViewController, animated: true, completion: nil) 54 | } 55 | 56 | } 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Example/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | -------------------------------------------------------------------------------- /Example/Tests/Tests.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import XCTest 3 | import SideNavigation 4 | 5 | class Tests: XCTestCase { 6 | 7 | override func setUp() { 8 | super.setUp() 9 | // Put setup code here. This method is called before the invocation of each test method in the class. 10 | } 11 | 12 | override func tearDown() { 13 | // Put teardown code here. This method is called after the invocation of each test method in the class. 14 | super.tearDown() 15 | } 16 | 17 | func testExample() { 18 | // This is an example of a functional test case. 19 | XCTAssert(true, "Pass") 20 | } 21 | 22 | func testPerformanceExample() { 23 | // This is an example of a performance test case. 24 | self.measure() { 25 | // Put the code you want to measure the time of here. 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 wangchengqvan@gmail.com 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SideNavigation 2 | 3 | [![CI Status](http://img.shields.io/travis/cnkcq/SideNavigation.svg?style=flat)](https://travis-ci.org/wangchengqvan@gmail.com/SideNavigation) 4 | [![Version](https://img.shields.io/cocoapods/v/SideNavigation.svg?style=flat)](http://cocoapods.org/pods/SideNavigation) 5 | [![License](https://img.shields.io/cocoapods/l/SideNavigation.svg?style=flat)](http://cocoapods.org/pods/SideNavigation) 6 | [![Platform](https://img.shields.io/cocoapods/p/SideNavigation.svg?style=flat)](http://cocoapods.org/pods/SideNavigation) 7 | 8 | ## Features 9 | 10 | - [x] A Side menu. 11 | - [x] Draggable. 12 | - [x] ipad support. 13 | - [x] Independent components. 14 | ##### :eyes: See also: 15 | ![SideNavigation_display](https://thumbs.gfycat.com/MagnificentWhichFlyinglemur-size_restricted.gif) 16 | 17 | ## Example 18 | 19 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 20 | 21 | ## Requirements 22 | - iOS 8.0+ 23 | - Swift 3 ( < 1.0.7 ), Swift 4 ( >= 1.0.7 ), Swift 5, Objective-C 24 | 25 | ## Installation 26 | 27 | SideNavigation is available through [CocoaPods](http://cocoapods.org). To install 28 | it, simply add the following line to your Podfile: 29 | 30 | ```ruby 31 | pod "SideNavigation" 32 | ``` 33 | ## Usage 34 | Please see [example](https://github.com/CNKCQ/SideNavigation/tree/master/Example) or [Objective-C example](https://github.com/CNKCQ/SideNavigation/tree/master/SideNavigation-Objective-C) 35 | ## Welcome 36 | Welcome to contribute 37 | ## Author 38 | 39 | wangchengqvan@gmail.com, chengquan.wang@ele.me 40 | 41 | ## License 42 | 43 | SideNavigation is available under the MIT license. See the LICENSE file for more info. 44 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'SideNavigation-Objective-C' do 5 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks 6 | use_frameworks! 7 | 8 | pod "SideNavigation", :git => 'https://github.com/CNKCQ/SideNavigation.git' 9 | pod 'MLeaksFinder' 10 | 11 | 12 | end 13 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - FBRetainCycleDetector (0.1.3) 3 | - MLeaksFinder (0.2.1): 4 | - FBRetainCycleDetector 5 | - SideNavigation (1.0.3) 6 | 7 | DEPENDENCIES: 8 | - MLeaksFinder 9 | - SideNavigation (from `https://github.com/CNKCQ/SideNavigation.git`) 10 | 11 | EXTERNAL SOURCES: 12 | SideNavigation: 13 | :git: https://github.com/CNKCQ/SideNavigation.git 14 | 15 | CHECKOUT OPTIONS: 16 | SideNavigation: 17 | :commit: ad7c6fee1d03e3d5722ecf2aa8b70826d4fb339f 18 | :git: https://github.com/CNKCQ/SideNavigation.git 19 | 20 | SPEC CHECKSUMS: 21 | FBRetainCycleDetector: f0c7b290bf48ae77f6ae060843ce34ae341781eb 22 | MLeaksFinder: '0850e2f2abc7227adc4d4e2d1992b431264eb4d5' 23 | SideNavigation: 8b1b9c84e2405b0825fcc600617da08b60d651d1 24 | 25 | PODFILE CHECKSUM: a745f8a66c7206c02b561f5b8a0a27b3ebd40430 26 | 27 | COCOAPODS: 1.2.1 28 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7B86B07A00FAF211DB75A2D5 /* Pods_SideNavigation_Objective_C.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24802977DDF240D079900C70 /* Pods_SideNavigation_Objective_C.framework */; }; 11 | AA1A9F5D1F35DB6500CF165F /* TestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AA1A9F5C1F35DB6500CF165F /* TestViewController.m */; }; 12 | AA25D7F81F322DCF00EDE0E2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AA25D7F71F322DCF00EDE0E2 /* main.m */; }; 13 | AA25D7FB1F322DCF00EDE0E2 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AA25D7FA1F322DCF00EDE0E2 /* AppDelegate.m */; }; 14 | AA25D8011F322DCF00EDE0E2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA25D7FF1F322DCF00EDE0E2 /* Main.storyboard */; }; 15 | AA25D8031F322DCF00EDE0E2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AA25D8021F322DCF00EDE0E2 /* Assets.xcassets */; }; 16 | AA25D8061F322DCF00EDE0E2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA25D8041F322DCF00EDE0E2 /* LaunchScreen.storyboard */; }; 17 | AA25D8131F322E7400EDE0E2 /* LeftViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AA25D80E1F322E7400EDE0E2 /* LeftViewController.m */; }; 18 | AA25D8141F322E7400EDE0E2 /* RightViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AA25D8101F322E7400EDE0E2 /* RightViewController.m */; }; 19 | AA25D8151F322E7400EDE0E2 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AA25D8121F322E7400EDE0E2 /* ViewController.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 047850881AE28E9F740B64EE /* Pods-SideNavigation-Objective-C.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SideNavigation-Objective-C.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SideNavigation-Objective-C/Pods-SideNavigation-Objective-C.debug.xcconfig"; sourceTree = ""; }; 24 | 24802977DDF240D079900C70 /* Pods_SideNavigation_Objective_C.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SideNavigation_Objective_C.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | AA1A9F5B1F35DB6500CF165F /* TestViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestViewController.h; sourceTree = ""; }; 26 | AA1A9F5C1F35DB6500CF165F /* TestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestViewController.m; sourceTree = ""; }; 27 | AA25D7F31F322DCF00EDE0E2 /* SideNavigation-Objective-C.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SideNavigation-Objective-C.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | AA25D7F71F322DCF00EDE0E2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29 | AA25D7F91F322DCF00EDE0E2 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 30 | AA25D7FA1F322DCF00EDE0E2 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 31 | AA25D8001F322DCF00EDE0E2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 32 | AA25D8021F322DCF00EDE0E2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 33 | AA25D8051F322DCF00EDE0E2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 34 | AA25D8071F322DCF00EDE0E2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | AA25D80D1F322E7400EDE0E2 /* LeftViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LeftViewController.h; sourceTree = ""; }; 36 | AA25D80E1F322E7400EDE0E2 /* LeftViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LeftViewController.m; sourceTree = ""; }; 37 | AA25D80F1F322E7400EDE0E2 /* RightViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RightViewController.h; sourceTree = ""; }; 38 | AA25D8101F322E7400EDE0E2 /* RightViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RightViewController.m; sourceTree = ""; }; 39 | AA25D8111F322E7400EDE0E2 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 40 | AA25D8121F322E7400EDE0E2 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 41 | B66508BA2CBE51FC5D81B60C /* Pods-SideNavigation-Objective-C.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SideNavigation-Objective-C.release.xcconfig"; path = "Pods/Target Support Files/Pods-SideNavigation-Objective-C/Pods-SideNavigation-Objective-C.release.xcconfig"; sourceTree = ""; }; 42 | /* End PBXFileReference section */ 43 | 44 | /* Begin PBXFrameworksBuildPhase section */ 45 | AA25D7F01F322DCF00EDE0E2 /* Frameworks */ = { 46 | isa = PBXFrameworksBuildPhase; 47 | buildActionMask = 2147483647; 48 | files = ( 49 | 7B86B07A00FAF211DB75A2D5 /* Pods_SideNavigation_Objective_C.framework in Frameworks */, 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | /* End PBXFrameworksBuildPhase section */ 54 | 55 | /* Begin PBXGroup section */ 56 | 23BCDF6D245E976C8CBFFDA6 /* Pods */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 047850881AE28E9F740B64EE /* Pods-SideNavigation-Objective-C.debug.xcconfig */, 60 | B66508BA2CBE51FC5D81B60C /* Pods-SideNavigation-Objective-C.release.xcconfig */, 61 | ); 62 | name = Pods; 63 | sourceTree = ""; 64 | }; 65 | 2C58E6B9CEC5ED9D544CD3D1 /* Frameworks */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | 24802977DDF240D079900C70 /* Pods_SideNavigation_Objective_C.framework */, 69 | ); 70 | name = Frameworks; 71 | sourceTree = ""; 72 | }; 73 | AA25D7EA1F322DCF00EDE0E2 = { 74 | isa = PBXGroup; 75 | children = ( 76 | AA25D7F51F322DCF00EDE0E2 /* SideNavigation-Objective-C */, 77 | AA25D7F41F322DCF00EDE0E2 /* Products */, 78 | 23BCDF6D245E976C8CBFFDA6 /* Pods */, 79 | 2C58E6B9CEC5ED9D544CD3D1 /* Frameworks */, 80 | ); 81 | sourceTree = ""; 82 | }; 83 | AA25D7F41F322DCF00EDE0E2 /* Products */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | AA25D7F31F322DCF00EDE0E2 /* SideNavigation-Objective-C.app */, 87 | ); 88 | name = Products; 89 | sourceTree = ""; 90 | }; 91 | AA25D7F51F322DCF00EDE0E2 /* SideNavigation-Objective-C */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | AA25D80D1F322E7400EDE0E2 /* LeftViewController.h */, 95 | AA25D80E1F322E7400EDE0E2 /* LeftViewController.m */, 96 | AA25D80F1F322E7400EDE0E2 /* RightViewController.h */, 97 | AA25D8101F322E7400EDE0E2 /* RightViewController.m */, 98 | AA25D8111F322E7400EDE0E2 /* ViewController.h */, 99 | AA25D8121F322E7400EDE0E2 /* ViewController.m */, 100 | AA25D7F91F322DCF00EDE0E2 /* AppDelegate.h */, 101 | AA25D7FA1F322DCF00EDE0E2 /* AppDelegate.m */, 102 | AA1A9F5B1F35DB6500CF165F /* TestViewController.h */, 103 | AA1A9F5C1F35DB6500CF165F /* TestViewController.m */, 104 | AA25D7FF1F322DCF00EDE0E2 /* Main.storyboard */, 105 | AA25D8021F322DCF00EDE0E2 /* Assets.xcassets */, 106 | AA25D8041F322DCF00EDE0E2 /* LaunchScreen.storyboard */, 107 | AA25D8071F322DCF00EDE0E2 /* Info.plist */, 108 | AA25D7F61F322DCF00EDE0E2 /* Supporting Files */, 109 | ); 110 | path = "SideNavigation-Objective-C"; 111 | sourceTree = ""; 112 | }; 113 | AA25D7F61F322DCF00EDE0E2 /* Supporting Files */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | AA25D7F71F322DCF00EDE0E2 /* main.m */, 117 | ); 118 | name = "Supporting Files"; 119 | sourceTree = ""; 120 | }; 121 | /* End PBXGroup section */ 122 | 123 | /* Begin PBXNativeTarget section */ 124 | AA25D7F21F322DCF00EDE0E2 /* SideNavigation-Objective-C */ = { 125 | isa = PBXNativeTarget; 126 | buildConfigurationList = AA25D80A1F322DCF00EDE0E2 /* Build configuration list for PBXNativeTarget "SideNavigation-Objective-C" */; 127 | buildPhases = ( 128 | 6BAC05A581C117D1ED0F034F /* [CP] Check Pods Manifest.lock */, 129 | AA25D7EF1F322DCF00EDE0E2 /* Sources */, 130 | AA25D7F01F322DCF00EDE0E2 /* Frameworks */, 131 | AA25D7F11F322DCF00EDE0E2 /* Resources */, 132 | 8DC6EEFABC14FAF86529420F /* [CP] Embed Pods Frameworks */, 133 | 6218234FB745240E628536D6 /* [CP] Copy Pods Resources */, 134 | ); 135 | buildRules = ( 136 | ); 137 | dependencies = ( 138 | ); 139 | name = "SideNavigation-Objective-C"; 140 | productName = "SideNavigation-Objective-C"; 141 | productReference = AA25D7F31F322DCF00EDE0E2 /* SideNavigation-Objective-C.app */; 142 | productType = "com.apple.product-type.application"; 143 | }; 144 | /* End PBXNativeTarget section */ 145 | 146 | /* Begin PBXProject section */ 147 | AA25D7EB1F322DCF00EDE0E2 /* Project object */ = { 148 | isa = PBXProject; 149 | attributes = { 150 | LastUpgradeCheck = 0830; 151 | ORGANIZATIONNAME = Jack; 152 | TargetAttributes = { 153 | AA25D7F21F322DCF00EDE0E2 = { 154 | CreatedOnToolsVersion = 8.3.3; 155 | DevelopmentTeam = GTVM2F95ZD; 156 | ProvisioningStyle = Automatic; 157 | }; 158 | }; 159 | }; 160 | buildConfigurationList = AA25D7EE1F322DCF00EDE0E2 /* Build configuration list for PBXProject "SideNavigation-Objective-C" */; 161 | compatibilityVersion = "Xcode 3.2"; 162 | developmentRegion = English; 163 | hasScannedForEncodings = 0; 164 | knownRegions = ( 165 | en, 166 | Base, 167 | ); 168 | mainGroup = AA25D7EA1F322DCF00EDE0E2; 169 | productRefGroup = AA25D7F41F322DCF00EDE0E2 /* Products */; 170 | projectDirPath = ""; 171 | projectRoot = ""; 172 | targets = ( 173 | AA25D7F21F322DCF00EDE0E2 /* SideNavigation-Objective-C */, 174 | ); 175 | }; 176 | /* End PBXProject section */ 177 | 178 | /* Begin PBXResourcesBuildPhase section */ 179 | AA25D7F11F322DCF00EDE0E2 /* Resources */ = { 180 | isa = PBXResourcesBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | AA25D8061F322DCF00EDE0E2 /* LaunchScreen.storyboard in Resources */, 184 | AA25D8031F322DCF00EDE0E2 /* Assets.xcassets in Resources */, 185 | AA25D8011F322DCF00EDE0E2 /* Main.storyboard in Resources */, 186 | ); 187 | runOnlyForDeploymentPostprocessing = 0; 188 | }; 189 | /* End PBXResourcesBuildPhase section */ 190 | 191 | /* Begin PBXShellScriptBuildPhase section */ 192 | 6218234FB745240E628536D6 /* [CP] Copy Pods Resources */ = { 193 | isa = PBXShellScriptBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | ); 197 | inputPaths = ( 198 | ); 199 | name = "[CP] Copy Pods Resources"; 200 | outputPaths = ( 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | shellPath = /bin/sh; 204 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SideNavigation-Objective-C/Pods-SideNavigation-Objective-C-resources.sh\"\n"; 205 | showEnvVarsInLog = 0; 206 | }; 207 | 6BAC05A581C117D1ED0F034F /* [CP] Check Pods Manifest.lock */ = { 208 | isa = PBXShellScriptBuildPhase; 209 | buildActionMask = 2147483647; 210 | files = ( 211 | ); 212 | inputPaths = ( 213 | ); 214 | name = "[CP] Check Pods Manifest.lock"; 215 | outputPaths = ( 216 | ); 217 | runOnlyForDeploymentPostprocessing = 0; 218 | shellPath = /bin/sh; 219 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; 220 | showEnvVarsInLog = 0; 221 | }; 222 | 8DC6EEFABC14FAF86529420F /* [CP] Embed Pods Frameworks */ = { 223 | isa = PBXShellScriptBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | ); 227 | inputPaths = ( 228 | ); 229 | name = "[CP] Embed Pods Frameworks"; 230 | outputPaths = ( 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | shellPath = /bin/sh; 234 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SideNavigation-Objective-C/Pods-SideNavigation-Objective-C-frameworks.sh\"\n"; 235 | showEnvVarsInLog = 0; 236 | }; 237 | /* End PBXShellScriptBuildPhase section */ 238 | 239 | /* Begin PBXSourcesBuildPhase section */ 240 | AA25D7EF1F322DCF00EDE0E2 /* Sources */ = { 241 | isa = PBXSourcesBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | AA1A9F5D1F35DB6500CF165F /* TestViewController.m in Sources */, 245 | AA25D8131F322E7400EDE0E2 /* LeftViewController.m in Sources */, 246 | AA25D8141F322E7400EDE0E2 /* RightViewController.m in Sources */, 247 | AA25D7FB1F322DCF00EDE0E2 /* AppDelegate.m in Sources */, 248 | AA25D7F81F322DCF00EDE0E2 /* main.m in Sources */, 249 | AA25D8151F322E7400EDE0E2 /* ViewController.m in Sources */, 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | /* End PBXSourcesBuildPhase section */ 254 | 255 | /* Begin PBXVariantGroup section */ 256 | AA25D7FF1F322DCF00EDE0E2 /* Main.storyboard */ = { 257 | isa = PBXVariantGroup; 258 | children = ( 259 | AA25D8001F322DCF00EDE0E2 /* Base */, 260 | ); 261 | name = Main.storyboard; 262 | sourceTree = ""; 263 | }; 264 | AA25D8041F322DCF00EDE0E2 /* LaunchScreen.storyboard */ = { 265 | isa = PBXVariantGroup; 266 | children = ( 267 | AA25D8051F322DCF00EDE0E2 /* Base */, 268 | ); 269 | name = LaunchScreen.storyboard; 270 | sourceTree = ""; 271 | }; 272 | /* End PBXVariantGroup section */ 273 | 274 | /* Begin XCBuildConfiguration section */ 275 | AA25D8081F322DCF00EDE0E2 /* Debug */ = { 276 | isa = XCBuildConfiguration; 277 | buildSettings = { 278 | ALWAYS_SEARCH_USER_PATHS = NO; 279 | CLANG_ANALYZER_NONNULL = YES; 280 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 281 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 282 | CLANG_CXX_LIBRARY = "libc++"; 283 | CLANG_ENABLE_MODULES = YES; 284 | CLANG_ENABLE_OBJC_ARC = YES; 285 | CLANG_WARN_BOOL_CONVERSION = YES; 286 | CLANG_WARN_CONSTANT_CONVERSION = YES; 287 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 288 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 289 | CLANG_WARN_EMPTY_BODY = YES; 290 | CLANG_WARN_ENUM_CONVERSION = YES; 291 | CLANG_WARN_INFINITE_RECURSION = YES; 292 | CLANG_WARN_INT_CONVERSION = YES; 293 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 294 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 295 | CLANG_WARN_UNREACHABLE_CODE = YES; 296 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 297 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 298 | COPY_PHASE_STRIP = NO; 299 | DEBUG_INFORMATION_FORMAT = dwarf; 300 | ENABLE_STRICT_OBJC_MSGSEND = YES; 301 | ENABLE_TESTABILITY = YES; 302 | GCC_C_LANGUAGE_STANDARD = gnu99; 303 | GCC_DYNAMIC_NO_PIC = NO; 304 | GCC_NO_COMMON_BLOCKS = YES; 305 | GCC_OPTIMIZATION_LEVEL = 0; 306 | GCC_PREPROCESSOR_DEFINITIONS = ( 307 | "DEBUG=1", 308 | "$(inherited)", 309 | ); 310 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 311 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 312 | GCC_WARN_UNDECLARED_SELECTOR = YES; 313 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 314 | GCC_WARN_UNUSED_FUNCTION = YES; 315 | GCC_WARN_UNUSED_VARIABLE = YES; 316 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 317 | MTL_ENABLE_DEBUG_INFO = YES; 318 | ONLY_ACTIVE_ARCH = YES; 319 | SDKROOT = iphoneos; 320 | TARGETED_DEVICE_FAMILY = "1,2"; 321 | }; 322 | name = Debug; 323 | }; 324 | AA25D8091F322DCF00EDE0E2 /* Release */ = { 325 | isa = XCBuildConfiguration; 326 | buildSettings = { 327 | ALWAYS_SEARCH_USER_PATHS = NO; 328 | CLANG_ANALYZER_NONNULL = YES; 329 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 330 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 331 | CLANG_CXX_LIBRARY = "libc++"; 332 | CLANG_ENABLE_MODULES = YES; 333 | CLANG_ENABLE_OBJC_ARC = YES; 334 | CLANG_WARN_BOOL_CONVERSION = YES; 335 | CLANG_WARN_CONSTANT_CONVERSION = YES; 336 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 337 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 338 | CLANG_WARN_EMPTY_BODY = YES; 339 | CLANG_WARN_ENUM_CONVERSION = YES; 340 | CLANG_WARN_INFINITE_RECURSION = YES; 341 | CLANG_WARN_INT_CONVERSION = YES; 342 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 343 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 344 | CLANG_WARN_UNREACHABLE_CODE = YES; 345 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 346 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 347 | COPY_PHASE_STRIP = NO; 348 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 349 | ENABLE_NS_ASSERTIONS = NO; 350 | ENABLE_STRICT_OBJC_MSGSEND = YES; 351 | GCC_C_LANGUAGE_STANDARD = gnu99; 352 | GCC_NO_COMMON_BLOCKS = YES; 353 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 354 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 355 | GCC_WARN_UNDECLARED_SELECTOR = YES; 356 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 357 | GCC_WARN_UNUSED_FUNCTION = YES; 358 | GCC_WARN_UNUSED_VARIABLE = YES; 359 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 360 | MTL_ENABLE_DEBUG_INFO = NO; 361 | SDKROOT = iphoneos; 362 | TARGETED_DEVICE_FAMILY = "1,2"; 363 | VALIDATE_PRODUCT = YES; 364 | }; 365 | name = Release; 366 | }; 367 | AA25D80B1F322DCF00EDE0E2 /* Debug */ = { 368 | isa = XCBuildConfiguration; 369 | baseConfigurationReference = 047850881AE28E9F740B64EE /* Pods-SideNavigation-Objective-C.debug.xcconfig */; 370 | buildSettings = { 371 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 372 | DEVELOPMENT_TEAM = GTVM2F95ZD; 373 | INFOPLIST_FILE = "SideNavigation-Objective-C/Info.plist"; 374 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 375 | PRODUCT_BUNDLE_IDENTIFIER = "com.ele.SideNavigation-Objective-C"; 376 | PRODUCT_NAME = "$(TARGET_NAME)"; 377 | }; 378 | name = Debug; 379 | }; 380 | AA25D80C1F322DCF00EDE0E2 /* Release */ = { 381 | isa = XCBuildConfiguration; 382 | baseConfigurationReference = B66508BA2CBE51FC5D81B60C /* Pods-SideNavigation-Objective-C.release.xcconfig */; 383 | buildSettings = { 384 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 385 | DEVELOPMENT_TEAM = GTVM2F95ZD; 386 | INFOPLIST_FILE = "SideNavigation-Objective-C/Info.plist"; 387 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 388 | PRODUCT_BUNDLE_IDENTIFIER = "com.ele.SideNavigation-Objective-C"; 389 | PRODUCT_NAME = "$(TARGET_NAME)"; 390 | }; 391 | name = Release; 392 | }; 393 | /* End XCBuildConfiguration section */ 394 | 395 | /* Begin XCConfigurationList section */ 396 | AA25D7EE1F322DCF00EDE0E2 /* Build configuration list for PBXProject "SideNavigation-Objective-C" */ = { 397 | isa = XCConfigurationList; 398 | buildConfigurations = ( 399 | AA25D8081F322DCF00EDE0E2 /* Debug */, 400 | AA25D8091F322DCF00EDE0E2 /* Release */, 401 | ); 402 | defaultConfigurationIsVisible = 0; 403 | defaultConfigurationName = Release; 404 | }; 405 | AA25D80A1F322DCF00EDE0E2 /* Build configuration list for PBXNativeTarget "SideNavigation-Objective-C" */ = { 406 | isa = XCConfigurationList; 407 | buildConfigurations = ( 408 | AA25D80B1F322DCF00EDE0E2 /* Debug */, 409 | AA25D80C1F322DCF00EDE0E2 /* Release */, 410 | ); 411 | defaultConfigurationIsVisible = 0; 412 | defaultConfigurationName = Release; 413 | }; 414 | /* End XCConfigurationList section */ 415 | }; 416 | rootObject = AA25D7EB1F322DCF00EDE0E2 /* Project object */; 417 | } 418 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SideNavigation-Objective-C 4 | // 5 | // Created by Steve on 2017/8/2. 6 | // Copyright © 2017年 Jack. 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 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SideNavigation-Objective-C 4 | // 5 | // Created by Steve on 2017/8/2. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/Assets.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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/Base.lproj/LaunchScreen.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 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/LeftViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LeftViewController.h 3 | // SideNavigation-Objective-C 4 | // 5 | // Created by Steve on 2017/8/2. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LeftViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/LeftViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LeftViewController.m 3 | // SideNavigation-Objective-C 4 | // 5 | // Created by Steve on 2017/8/2. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | #import "LeftViewController.h" 10 | 11 | @interface LeftViewController () 12 | 13 | @end 14 | 15 | @implementation LeftViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.view.backgroundColor = [UIColor brownColor]; 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 28 | [self dismissViewControllerAnimated:YES completion:nil]; 29 | } 30 | 31 | - (void)dealloc { 32 | NSLog(@"%@", NSStringFromClass([self class])); 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 | 45 | @end 46 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/RightViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RightViewController.h 3 | // SideNavigation-Objective-C 4 | // 5 | // Created by Steve on 2017/8/2. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RightViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/RightViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RightViewController.m 3 | // SideNavigation-Objective-C 4 | // 5 | // Created by Steve on 2017/8/2. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | #import "RightViewController.h" 10 | 11 | @interface RightViewController () 12 | 13 | @end 14 | 15 | @implementation RightViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.view.backgroundColor = [UIColor blueColor]; 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | - (void)dealloc { 28 | NSLog(@"%@", NSStringFromClass([self class])); 29 | } 30 | 31 | 32 | /* 33 | #pragma mark - Navigation 34 | 35 | // In a storyboard-based application, you will often want to do a little preparation before navigation 36 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 37 | // Get the new view controller using [segue destinationViewController]. 38 | // Pass the selected object to the new view controller. 39 | } 40 | */ 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/TestViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestViewController.h 3 | // SideNavigation-Objective-C 4 | // 5 | // Created by Steve on 2017/8/5. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TestViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/TestViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestViewController.m 3 | // SideNavigation-Objective-C 4 | // 5 | // Created by Steve on 2017/8/5. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | #import "TestViewController.h" 10 | #import "ViewController.h" 11 | 12 | @interface TestViewController () 13 | 14 | @end 15 | 16 | @implementation TestViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | self.view.backgroundColor = [UIColor brownColor]; 21 | 22 | } 23 | 24 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 25 | [self presentViewController:[ViewController new] animated:YES completion:nil]; 26 | 27 | } 28 | 29 | - (void)didReceiveMemoryWarning { 30 | [super didReceiveMemoryWarning]; 31 | // Dispose of any resources that can be recreated. 32 | } 33 | 34 | /* 35 | #pragma mark - Navigation 36 | 37 | // In a storyboard-based application, you will often want to do a little preparation before navigation 38 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 39 | // Get the new view controller using [segue destinationViewController]. 40 | // Pass the selected object to the new view controller. 41 | } 42 | */ 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // SideNavigation-Objective-C 4 | // 5 | // Created by Steve on 2017/8/2. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // SideNavigation-Objective-C 4 | // 5 | // Created by Steve on 2017/8/2. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "SideNavigation-Swift.h" 11 | #import "LeftViewController.h" 12 | #import "RightViewController.h" 13 | 14 | @interface ViewController () 15 | 16 | @property (nonatomic, strong) SideMenuManager *leftSide; 17 | @property (nonatomic, strong) SideMenuManager *rightSide; 18 | @property (nonatomic, strong) LeftViewController *left; 19 | @property (nonatomic, strong) RightViewController *right; 20 | 21 | 22 | @end 23 | 24 | @implementation ViewController 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | self.view.backgroundColor = [UIColor whiteColor]; 29 | _left = [LeftViewController new]; 30 | _leftSide = [[SideMenuManager alloc] init:self left:_left]; 31 | _right = [RightViewController new]; 32 | _rightSide = [[SideMenuManager alloc] init:self right:_right]; 33 | } 34 | 35 | - (void) viewWillAppear:(BOOL)animated { 36 | [super viewWillAppear:animated]; 37 | self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"left" style:UIBarButtonItemStylePlain target:self action:@selector(leftClick)]; 38 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"right" style:UIBarButtonItemStylePlain target:self action:@selector(rightClick)]; 39 | } 40 | 41 | - (void)leftClick { 42 | [self presentViewController:_left animated:YES completion:nil]; 43 | } 44 | 45 | - (void)rightClick { 46 | [self presentViewController:_right animated:YES completion:nil]; 47 | } 48 | 49 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 50 | [self dismissViewControllerAnimated:YES completion:nil]; 51 | } 52 | 53 | - (void)didReceiveMemoryWarning { 54 | [super didReceiveMemoryWarning]; 55 | 56 | } 57 | 58 | - (void)dealloc { 59 | NSLog(@"%@", NSStringFromClass([self class])); 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /SideNavigation-Objective-C/SideNavigation-Objective-C/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SideNavigation-Objective-C 4 | // 5 | // Created by Steve on 2017/8/2. 6 | // Copyright © 2017年 Jack. 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 | -------------------------------------------------------------------------------- /SideNavigation.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'SideNavigation' 3 | s.version = '1.1.3' 4 | s.swift_version = '5' 5 | s.summary = 'A short description of SideNavigation.' 6 | s.homepage = 'https://github.com/cnkcq/SideNavigation' 7 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 8 | s.license = { :type => 'MIT', :file => 'LICENSE' } 9 | s.author = { 'cnkcq' => 'chengquan.wang@ele.me' } 10 | s.source = { :git => 'https://github.com/cnkcq/SideNavigation.git', :tag => s.version.to_s } 11 | # s.social_media_url = 'https://twitter.com/' 12 | s.ios.deployment_target = '8.0' 13 | s.source_files = 'SideNavigation/Classes/**/*' 14 | # s.resource_bundles = { 15 | # 'SideNavigation' => ['SideNavigation/Assets/*.png'] 16 | # } 17 | # s.public_header_files = 'Pod/Classes/**/*.h' 18 | # s.frameworks = 'UIKit' 19 | end 20 | -------------------------------------------------------------------------------- /SideNavigation/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CNKCQ/SideNavigation/4ff6bc96ce6f589ca580be3ccffa4217a18b3074/SideNavigation/Assets/.gitkeep -------------------------------------------------------------------------------- /SideNavigation/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CNKCQ/SideNavigation/4ff6bc96ce6f589ca580be3ccffa4217a18b3074/SideNavigation/Classes/.gitkeep -------------------------------------------------------------------------------- /SideNavigation/Classes/AnimatedTransitioning.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnimatedTransitioning.swift 3 | // Slide 4 | // 5 | // Created by Steve on 2017/8/1. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | 10 | enum TransitioningType { 11 | case present 12 | case dismiss 13 | } 14 | 15 | class AnimatedTransitioning: NSObject { 16 | var transitionType: TransitioningType = .present 17 | var direction: Direction = .left 18 | var animationDuration: TimeInterval = 0.4 19 | } 20 | 21 | extension AnimatedTransitioning: UIViewControllerAnimatedTransitioning { 22 | 23 | func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { 24 | return animationDuration 25 | } 26 | 27 | func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { 28 | let from = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from) 29 | let to = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to) 30 | switch transitionType { 31 | case .present: 32 | animatePresenting(in: transitionContext, to: to!, from: from!) 33 | case .dismiss: 34 | animateDismissing(in: transitionContext, to: to!, from: from!) 35 | } 36 | } 37 | 38 | @objc func animatePresenting(in transitionContext: UIViewControllerContextTransitioning, to: UIViewController, from: UIViewController) { 39 | let fromRect = transitionContext.initialFrame(for: from) 40 | var toRect = transitionContext.initialFrame(for: from) 41 | switch direction { 42 | case .left: 43 | toRect.origin.x = -toRect.width 44 | case .right: 45 | toRect.origin.x = toRect.width 46 | } 47 | to.view.frame = toRect 48 | transitionContext.containerView.addSubview(to.view) 49 | UIView.animate(withDuration: animationDuration, animations: { 50 | to.view.frame = fromRect 51 | }) { (_) in 52 | if transitionContext.transitionWasCancelled { 53 | transitionContext.completeTransition(false) 54 | } else { 55 | transitionContext.completeTransition(true) 56 | } 57 | } 58 | } 59 | 60 | @objc func animateDismissing(in transitionContext: UIViewControllerContextTransitioning, to: UIViewController, from: UIViewController) { 61 | var fromRect = transitionContext.initialFrame(for: from) 62 | switch direction { 63 | case .left: 64 | fromRect.origin.x = -fromRect.width 65 | case .right: 66 | fromRect.origin.x = fromRect.width 67 | } 68 | UIView.animate(withDuration: animationDuration, animations: { 69 | from.view.frame = fromRect 70 | }) { (_) in 71 | if transitionContext.transitionWasCancelled { 72 | transitionContext.completeTransition(false) 73 | } else { 74 | transitionContext.completeTransition(true) 75 | } 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /SideNavigation/Classes/PercentDrivenInteractiveTransition.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PercentDrivenInteractiveTransition.swift 3 | // Slide 4 | // 5 | // Created by Steve on 2017/8/1. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class PercentDrivenInteractiveTransition: UIPercentDrivenInteractiveTransition, UIGestureRecognizerDelegate { 12 | @objc weak var viewController: UIViewController! 13 | @objc weak var presentViewController: UIViewController? 14 | 15 | @objc var shouldComplete: Bool = false 16 | @objc var isInteractiveTransition = false 17 | var direction: Direction = .left 18 | 19 | convenience init(_ viewController: UIViewController, with view: UIView?, present: UIViewController?, direction: Direction? = .left) { 20 | self.init() 21 | self.viewController = viewController 22 | self.direction = direction ?? .left 23 | self.presentViewController = present 24 | if self.presentViewController != nil { 25 | switch self.direction { 26 | case .left: 27 | let edgePanGesture = UIScreenEdgePanGestureRecognizer(target: self, action: #selector(onPan(sender:))) 28 | edgePanGesture.edges = .left 29 | edgePanGesture.delegate = self 30 | self.viewController.view.addGestureRecognizer(edgePanGesture) 31 | case .right: 32 | let edgePanGesture = UIScreenEdgePanGestureRecognizer(target: self, action: #selector(onPan(sender:))) 33 | edgePanGesture.edges = .right 34 | edgePanGesture.delegate = self 35 | self.viewController.view.addGestureRecognizer(edgePanGesture) 36 | break 37 | } 38 | } else { 39 | let panGesture = UIPanGestureRecognizer(target: self, action: #selector(onPan(sender:))) 40 | view?.addGestureRecognizer(panGesture) 41 | let dismissPanGesture = UIPanGestureRecognizer(target: self, action: #selector(onPan(sender:))) 42 | self.viewController.view.addGestureRecognizer(dismissPanGesture) 43 | } 44 | } 45 | 46 | func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { 47 | 48 | /// to avoid the interactivePopGestureRecognizer of UINavigationController 49 | if let nav = viewController as? UINavigationController { 50 | return nav.viewControllers.count < 2 51 | } 52 | return true 53 | } 54 | 55 | @objc func onPan(sender: UIPanGestureRecognizer) { 56 | let translation = sender.translation(in: sender.view?.superview) 57 | switch sender.state { 58 | case .began: 59 | self.isInteractiveTransition = true 60 | if self.presentViewController != nil { 61 | self.viewController.present(self.presentViewController!, animated: true, completion: nil) 62 | } else { 63 | self.viewController.dismiss(animated: true, completion: nil) 64 | } 65 | case .changed: 66 | let screenWidth = -UIScreen.main.bounds.size.width 67 | var dragAmount = self.presentViewController == nil ? screenWidth : -screenWidth 68 | switch direction { 69 | case .left: 70 | dragAmount = self.presentViewController == nil ? screenWidth : -screenWidth 71 | case .right: 72 | dragAmount = self.presentViewController != nil ? screenWidth : -screenWidth 73 | } 74 | let threshold: CGFloat = 0.20 75 | var percent = translation.x / dragAmount 76 | percent = max(percent, 0.0) 77 | percent = min(percent, 1.0) 78 | update(percent) 79 | self.shouldComplete = percent > threshold 80 | case .cancelled, .ended: 81 | self.isInteractiveTransition = false 82 | if self.shouldComplete == false || sender.state == .cancelled { 83 | cancel() 84 | } else { 85 | finish() 86 | } 87 | default: 88 | break 89 | } 90 | } 91 | 92 | private override init() { 93 | super.init() 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /SideNavigation/Classes/PresentationController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PresentationController.swift 3 | // Slide 4 | // 5 | // Created by Steve on 2017/8/1. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | class PresentationController: UIPresentationController { 10 | var direction: Direction = .left 11 | var sideScale: CGFloat = 1.0 / 3.0 12 | 13 | // MARK: - Initializers 14 | override init(presentedViewController: UIViewController, presenting presentingViewController: UIViewController?) { 15 | super.init(presentedViewController: presentedViewController, presenting: presentingViewController) 16 | } 17 | 18 | override var frameOfPresentedViewInContainerView: CGRect { 19 | var frame: CGRect = super.frameOfPresentedViewInContainerView 20 | switch direction { 21 | case .right: 22 | frame.origin.x = frame.size.width * (1 - sideScale) 23 | break 24 | case .left: 25 | break 26 | } 27 | frame.size = size(forChildContentContainer: presentedViewController, withParentContainerSize: containerView!.bounds.size) 28 | return frame 29 | } 30 | 31 | override func containerViewWillLayoutSubviews() { 32 | presentedView?.frame = frameOfPresentedViewInContainerView 33 | } 34 | 35 | override func size(forChildContentContainer container: UIContentContainer, withParentContainerSize parentSize: CGSize) -> CGSize { 36 | var size = CGSize.zero 37 | switch direction { 38 | case .left: 39 | size = CGSize(width: parentSize.width * sideScale, height: parentSize.height) 40 | break 41 | case .right: 42 | size = CGSize(width: parentSize.width, height: parentSize.height) 43 | break 44 | } 45 | return size 46 | } 47 | 48 | override func presentationTransitionWillBegin() { 49 | containerView?.insertSubview(dimmingView, at: 0) 50 | NSLayoutConstraint.activate(NSLayoutConstraint.constraints(withVisualFormat: "V:|[dimmingView]|", options: [], metrics: nil, views: ["dimmingView": dimmingView])) 51 | NSLayoutConstraint.activate(NSLayoutConstraint.constraints(withVisualFormat: "H:|[dimmingView]|", options: [], metrics: nil, views: ["dimmingView": dimmingView])) 52 | guard let coordinator = presentedViewController.transitionCoordinator else { 53 | dimmingView.alpha = 1.0 54 | return 55 | } 56 | 57 | coordinator.animate(alongsideTransition: { _ in 58 | self.dimmingView.alpha = 1.0 59 | }) 60 | } 61 | 62 | override func dismissalTransitionWillBegin() { 63 | guard let coordinator = presentedViewController.transitionCoordinator else { 64 | dimmingView.alpha = 0.0 65 | return 66 | } 67 | 68 | coordinator.animate(alongsideTransition: { _ in 69 | self.dimmingView.alpha = 0.0 70 | }) 71 | } 72 | 73 | @objc lazy var dimmingView: UIView = { 74 | let dimming = UIView() 75 | dimming.translatesAutoresizingMaskIntoConstraints = false 76 | dimming.backgroundColor = UIColor(white: 0.0, alpha: 0.5) 77 | dimming.alpha = 0.0 78 | let recognizer = UITapGestureRecognizer(target: self, action: #selector(handleTap(recognizer:))) 79 | dimming.addGestureRecognizer(recognizer) 80 | return dimming 81 | }() 82 | 83 | @objc dynamic func handleTap(recognizer: UITapGestureRecognizer) { 84 | presentingViewController.dismiss(animated: true) 85 | } 86 | } 87 | 88 | -------------------------------------------------------------------------------- /SideNavigation/Classes/SideMenuManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SlideMenuManager.swift 3 | // Slide 4 | // 5 | // Created by Steve on 2017/8/1. 6 | // Copyright © 2017年 Jack. All rights reserved. 7 | // 8 | 9 | public enum Direction { 10 | case left 11 | case right 12 | } 13 | 14 | public class SideMenuManager: NSObject { 15 | @objc weak var viewController: UIViewController! 16 | @objc weak var presentController: UIViewController! 17 | @objc var presentInteractor: PercentDrivenInteractiveTransition! 18 | @objc var dismissInteractor: PercentDrivenInteractiveTransition! 19 | public var sideScale: CGFloat = 1.0 / 3.0 20 | public var animationDuration: TimeInterval = 0.4 21 | var direction: Direction = .left 22 | 23 | @objc @discardableResult 24 | public convenience init(_ viewController: UIViewController, left: UIViewController) { 25 | self.init() 26 | self.viewController = viewController 27 | self.presentController = left 28 | self.direction = .left 29 | self.configPresent() 30 | } 31 | 32 | @objc @discardableResult 33 | public convenience init(_ viewController: UIViewController, right: UIViewController) { 34 | self.init() 35 | self.viewController = viewController 36 | self.presentController = right 37 | self.direction = .right 38 | self.configPresent() 39 | } 40 | 41 | @objc func configPresent() { 42 | self.presentController?.transitioningDelegate = self 43 | self.presentController?.modalPresentationStyle = .custom 44 | self.presentInteractor = PercentDrivenInteractiveTransition(viewController, with: viewController.view, present: self.presentController, direction: self.direction) 45 | } 46 | 47 | private override init() { 48 | super.init() 49 | } 50 | } 51 | 52 | extension SideMenuManager: UIViewControllerTransitioningDelegate { 53 | 54 | public func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { 55 | let presentationController = PresentationController(presentedViewController: presented, presenting: presenting) 56 | presentationController.delegate = self 57 | presentationController.direction = direction 58 | presentationController.sideScale = sideScale 59 | self.dismissInteractor = PercentDrivenInteractiveTransition(self.presentController, with: presentationController.dimmingView, present: nil, direction: self.direction) 60 | return presentationController 61 | } 62 | 63 | public func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { 64 | let animator = AnimatedTransitioning() 65 | animator.animationDuration = animationDuration 66 | animator.direction = direction 67 | animator.transitionType = .dismiss 68 | return animator 69 | } 70 | 71 | public func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { 72 | let animator = AnimatedTransitioning() 73 | animator.animationDuration = animationDuration 74 | animator.direction = direction 75 | animator.transitionType = .present 76 | return animator 77 | } 78 | 79 | public func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { 80 | return self.dismissInteractor.isInteractiveTransition ? self.dismissInteractor : nil 81 | } 82 | 83 | public func interactionControllerForPresentation(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { 84 | return self.presentInteractor.isInteractiveTransition ? self.presentInteractor : nil 85 | } 86 | } 87 | 88 | extension SideMenuManager: UIAdaptivePresentationControllerDelegate { 89 | public func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle { 90 | return self.viewController.traitCollection.verticalSizeClass == .compact ? .overFullScreen : .none 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj -------------------------------------------------------------------------------- /issue_template.md: -------------------------------------------------------------------------------- 1 | > ℹ Please fill out this template when filing an issue. 2 | > All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info. 3 | > 4 | > bugs and feature requests, not general support. 5 | > 6 | > Please remove this line and everything above it before submitting. 7 | 8 | * [ ] I've read, understood, and done my best to follow the steps. 9 | 10 | ## What did you do? 11 | 12 | ℹ Please replace this with what you did. 13 | 14 | ## What did you expect to happen? 15 | 16 | ℹ Please replace this with what you expected to happen. 17 | 18 | ## What happened instead? 19 | 20 | ℹ Please replace this with of what happened instead. 21 | 22 | ## SideNavigation Environment 23 | 24 | **SideNavigation version:** 25 | **Xcode version:** 26 | **Platform(s) running SideNavigation:** 27 | **macOS version running Xcode:** 28 | 29 | ## Demo Project 30 | 31 | ℹ Please link to or upload a project we can download that reproduces the issue. 32 | 33 | 34 | --------------------------------------------------------------------------------