├── .gitignore ├── LICENSE ├── Project ├── XHDrawerController.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── XHDrawerController │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── 120.png │ │ │ ├── 152.png │ │ │ ├── 72.png │ │ │ ├── 76.png │ │ │ └── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ ├── Contents.json │ │ │ ├── Default-568h@2x.png │ │ │ ├── Default-Portrait.png │ │ │ ├── Default-Portrait@2x.png │ │ │ └── Default@2x.png │ │ ├── MenuBackground.imageset │ │ │ ├── Contents.json │ │ │ └── MenuBackground@2x.png │ │ └── me.imageset │ │ │ ├── Contents.json │ │ │ └── 未标题-1.png │ ├── XHDrawerController-Info.plist │ ├── XHDrawerController-Prefix.pch │ ├── XHExampleCenterSideDrawerViewController.h │ ├── XHExampleCenterSideDrawerViewController.m │ ├── XHExampleLeftSideDrawerViewController.h │ ├── XHExampleLeftSideDrawerViewController.m │ ├── XHExampleRightSideDrawerViewController.h │ ├── XHExampleRightSideDrawerViewController.m │ ├── XHExampleSideDrawerViewController.h │ ├── XHExampleSideDrawerViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── XHDrawerControllerSDK │ ├── XHDrawerControllerSDK-Info.plist │ ├── XHDrawerControllerSDK-Prefix.pch │ └── en.lproj │ │ └── InfoPlist.strings └── XHDrawerControllerTests │ ├── XHDrawerControllerTests-Info.plist │ ├── XHDrawerControllerTests.m │ └── en.lproj │ └── InfoPlist.strings ├── README.md ├── Screenshots └── XHDrawerController.gif ├── Source ├── XHDrawerController.h ├── XHDrawerController.m ├── XHDrawerControllerHeader.h ├── XHZoomDrawerView.h └── XHZoomDrawerView.m └── XHDrawerController.podspec /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | *.xccheckout 19 | 20 | #CocoaPods 21 | Pods 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 JackTeam 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Project/XHDrawerController.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | AB38B9BE186DB4370033AECA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB38B9BD186DB4370033AECA /* Foundation.framework */; }; 11 | AB38B9C0186DB4370033AECA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB38B9BF186DB4370033AECA /* CoreGraphics.framework */; }; 12 | AB38B9C2186DB4370033AECA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB38B9C1186DB4370033AECA /* UIKit.framework */; }; 13 | AB38B9C8186DB4370033AECA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AB38B9C6186DB4370033AECA /* InfoPlist.strings */; }; 14 | AB38B9CA186DB4370033AECA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AB38B9C9186DB4370033AECA /* main.m */; }; 15 | AB38B9CE186DB4370033AECA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AB38B9CD186DB4370033AECA /* AppDelegate.m */; }; 16 | AB38B9D9186DB4370033AECA /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AB38B9D8186DB4370033AECA /* Images.xcassets */; }; 17 | AB38B9E0186DB4380033AECA /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB38B9DF186DB4380033AECA /* XCTest.framework */; }; 18 | AB38B9E1186DB4380033AECA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB38B9BD186DB4370033AECA /* Foundation.framework */; }; 19 | AB38B9E2186DB4380033AECA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB38B9C1186DB4370033AECA /* UIKit.framework */; }; 20 | AB38B9EA186DB4380033AECA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AB38B9E8186DB4380033AECA /* InfoPlist.strings */; }; 21 | AB38B9EC186DB4380033AECA /* XHDrawerControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = AB38B9EB186DB4380033AECA /* XHDrawerControllerTests.m */; }; 22 | AB38B9F9186DB4D50033AECA /* XHDrawerController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB38B9F8186DB4D50033AECA /* XHDrawerController.m */; }; 23 | AB38BA08186DB5070033AECA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AB38BA06186DB5070033AECA /* InfoPlist.strings */; }; 24 | AB38BA0D186DB5140033AECA /* XHDrawerController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB38B9F8186DB4D50033AECA /* XHDrawerController.m */; }; 25 | AB38BA0E186DB5250033AECA /* XHDrawerController.h in Headers */ = {isa = PBXBuildFile; fileRef = AB38B9F7186DB4D50033AECA /* XHDrawerController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 26 | AB38BA11186DBE820033AECA /* XHZoomDrawerView.h in Headers */ = {isa = PBXBuildFile; fileRef = AB38BA0F186DBE820033AECA /* XHZoomDrawerView.h */; }; 27 | AB38BA12186DBE820033AECA /* XHZoomDrawerView.m in Sources */ = {isa = PBXBuildFile; fileRef = AB38BA10186DBE820033AECA /* XHZoomDrawerView.m */; }; 28 | AB38BA13186DBE820033AECA /* XHZoomDrawerView.m in Sources */ = {isa = PBXBuildFile; fileRef = AB38BA10186DBE820033AECA /* XHZoomDrawerView.m */; }; 29 | AB38BA16186DBFBC0033AECA /* XHDrawerControllerHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = AB38BA15186DBFBC0033AECA /* XHDrawerControllerHeader.h */; }; 30 | AB38BA19186DDA6B0033AECA /* XHExampleSideDrawerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB38BA18186DDA6B0033AECA /* XHExampleSideDrawerViewController.m */; }; 31 | AB38BA1C186DDA840033AECA /* XHExampleLeftSideDrawerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB38BA1B186DDA840033AECA /* XHExampleLeftSideDrawerViewController.m */; }; 32 | AB38BA1F186DDA920033AECA /* XHExampleRightSideDrawerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB38BA1E186DDA920033AECA /* XHExampleRightSideDrawerViewController.m */; }; 33 | AB38BA22186DDB260033AECA /* XHExampleCenterSideDrawerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB38BA21186DDB260033AECA /* XHExampleCenterSideDrawerViewController.m */; }; 34 | /* End PBXBuildFile section */ 35 | 36 | /* Begin PBXContainerItemProxy section */ 37 | AB38B9E3186DB4380033AECA /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = AB38B9B2186DB4370033AECA /* Project object */; 40 | proxyType = 1; 41 | remoteGlobalIDString = AB38B9B9186DB4370033AECA; 42 | remoteInfo = XHDrawerController; 43 | }; 44 | /* End PBXContainerItemProxy section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | AB38B9BA186DB4370033AECA /* XHDrawerController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = XHDrawerController.app; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | AB38B9BD186DB4370033AECA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 49 | AB38B9BF186DB4370033AECA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 50 | AB38B9C1186DB4370033AECA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 51 | AB38B9C5186DB4370033AECA /* XHDrawerController-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "XHDrawerController-Info.plist"; sourceTree = ""; }; 52 | AB38B9C7186DB4370033AECA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 53 | AB38B9C9186DB4370033AECA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 54 | AB38B9CB186DB4370033AECA /* XHDrawerController-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XHDrawerController-Prefix.pch"; sourceTree = ""; }; 55 | AB38B9CC186DB4370033AECA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 56 | AB38B9CD186DB4370033AECA /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 57 | AB38B9D8186DB4370033AECA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 58 | AB38B9DE186DB4380033AECA /* XHDrawerControllerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XHDrawerControllerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | AB38B9DF186DB4380033AECA /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 60 | AB38B9E7186DB4380033AECA /* XHDrawerControllerTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "XHDrawerControllerTests-Info.plist"; sourceTree = ""; }; 61 | AB38B9E9186DB4380033AECA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 62 | AB38B9EB186DB4380033AECA /* XHDrawerControllerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XHDrawerControllerTests.m; sourceTree = ""; }; 63 | AB38B9F7186DB4D50033AECA /* XHDrawerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHDrawerController.h; sourceTree = ""; }; 64 | AB38B9F8186DB4D50033AECA /* XHDrawerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHDrawerController.m; sourceTree = ""; }; 65 | AB38BA02186DB5070033AECA /* XHDrawerControllerSDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XHDrawerControllerSDK.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | AB38BA05186DB5070033AECA /* XHDrawerControllerSDK-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "XHDrawerControllerSDK-Info.plist"; sourceTree = ""; }; 67 | AB38BA07186DB5070033AECA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 68 | AB38BA09186DB5070033AECA /* XHDrawerControllerSDK-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XHDrawerControllerSDK-Prefix.pch"; sourceTree = ""; }; 69 | AB38BA0F186DBE820033AECA /* XHZoomDrawerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHZoomDrawerView.h; sourceTree = ""; }; 70 | AB38BA10186DBE820033AECA /* XHZoomDrawerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHZoomDrawerView.m; sourceTree = ""; }; 71 | AB38BA15186DBFBC0033AECA /* XHDrawerControllerHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHDrawerControllerHeader.h; sourceTree = ""; }; 72 | AB38BA17186DDA6B0033AECA /* XHExampleSideDrawerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHExampleSideDrawerViewController.h; sourceTree = ""; }; 73 | AB38BA18186DDA6B0033AECA /* XHExampleSideDrawerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHExampleSideDrawerViewController.m; sourceTree = ""; }; 74 | AB38BA1A186DDA840033AECA /* XHExampleLeftSideDrawerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHExampleLeftSideDrawerViewController.h; sourceTree = ""; }; 75 | AB38BA1B186DDA840033AECA /* XHExampleLeftSideDrawerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHExampleLeftSideDrawerViewController.m; sourceTree = ""; }; 76 | AB38BA1D186DDA920033AECA /* XHExampleRightSideDrawerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHExampleRightSideDrawerViewController.h; sourceTree = ""; }; 77 | AB38BA1E186DDA920033AECA /* XHExampleRightSideDrawerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHExampleRightSideDrawerViewController.m; sourceTree = ""; }; 78 | AB38BA20186DDB260033AECA /* XHExampleCenterSideDrawerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHExampleCenterSideDrawerViewController.h; sourceTree = ""; }; 79 | AB38BA21186DDB260033AECA /* XHExampleCenterSideDrawerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHExampleCenterSideDrawerViewController.m; sourceTree = ""; }; 80 | /* End PBXFileReference section */ 81 | 82 | /* Begin PBXFrameworksBuildPhase section */ 83 | AB38B9B7186DB4370033AECA /* Frameworks */ = { 84 | isa = PBXFrameworksBuildPhase; 85 | buildActionMask = 2147483647; 86 | files = ( 87 | AB38B9C0186DB4370033AECA /* CoreGraphics.framework in Frameworks */, 88 | AB38B9C2186DB4370033AECA /* UIKit.framework in Frameworks */, 89 | AB38B9BE186DB4370033AECA /* Foundation.framework in Frameworks */, 90 | ); 91 | runOnlyForDeploymentPostprocessing = 0; 92 | }; 93 | AB38B9DB186DB4380033AECA /* Frameworks */ = { 94 | isa = PBXFrameworksBuildPhase; 95 | buildActionMask = 2147483647; 96 | files = ( 97 | AB38B9E0186DB4380033AECA /* XCTest.framework in Frameworks */, 98 | AB38B9E2186DB4380033AECA /* UIKit.framework in Frameworks */, 99 | AB38B9E1186DB4380033AECA /* Foundation.framework in Frameworks */, 100 | ); 101 | runOnlyForDeploymentPostprocessing = 0; 102 | }; 103 | AB38B9FC186DB5070033AECA /* Frameworks */ = { 104 | isa = PBXFrameworksBuildPhase; 105 | buildActionMask = 2147483647; 106 | files = ( 107 | ); 108 | runOnlyForDeploymentPostprocessing = 0; 109 | }; 110 | /* End PBXFrameworksBuildPhase section */ 111 | 112 | /* Begin PBXGroup section */ 113 | AB38B9B1186DB4370033AECA = { 114 | isa = PBXGroup; 115 | children = ( 116 | AB38B9F6186DB4B40033AECA /* Source */, 117 | AB38B9C3186DB4370033AECA /* XHDrawerController */, 118 | AB38B9E5186DB4380033AECA /* XHDrawerControllerTests */, 119 | AB38BA03186DB5070033AECA /* XHDrawerControllerSDK */, 120 | AB38B9BC186DB4370033AECA /* Frameworks */, 121 | AB38B9BB186DB4370033AECA /* Products */, 122 | ); 123 | sourceTree = ""; 124 | }; 125 | AB38B9BB186DB4370033AECA /* Products */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | AB38B9BA186DB4370033AECA /* XHDrawerController.app */, 129 | AB38B9DE186DB4380033AECA /* XHDrawerControllerTests.xctest */, 130 | AB38BA02186DB5070033AECA /* XHDrawerControllerSDK.framework */, 131 | ); 132 | name = Products; 133 | sourceTree = ""; 134 | }; 135 | AB38B9BC186DB4370033AECA /* Frameworks */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | AB38B9BD186DB4370033AECA /* Foundation.framework */, 139 | AB38B9BF186DB4370033AECA /* CoreGraphics.framework */, 140 | AB38B9C1186DB4370033AECA /* UIKit.framework */, 141 | AB38B9DF186DB4380033AECA /* XCTest.framework */, 142 | ); 143 | name = Frameworks; 144 | sourceTree = ""; 145 | }; 146 | AB38B9C3186DB4370033AECA /* XHDrawerController */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | AB38B9CC186DB4370033AECA /* AppDelegate.h */, 150 | AB38B9CD186DB4370033AECA /* AppDelegate.m */, 151 | AB38BA17186DDA6B0033AECA /* XHExampleSideDrawerViewController.h */, 152 | AB38BA18186DDA6B0033AECA /* XHExampleSideDrawerViewController.m */, 153 | AB38BA1A186DDA840033AECA /* XHExampleLeftSideDrawerViewController.h */, 154 | AB38BA1B186DDA840033AECA /* XHExampleLeftSideDrawerViewController.m */, 155 | AB38BA1D186DDA920033AECA /* XHExampleRightSideDrawerViewController.h */, 156 | AB38BA1E186DDA920033AECA /* XHExampleRightSideDrawerViewController.m */, 157 | AB38BA20186DDB260033AECA /* XHExampleCenterSideDrawerViewController.h */, 158 | AB38BA21186DDB260033AECA /* XHExampleCenterSideDrawerViewController.m */, 159 | AB38B9D8186DB4370033AECA /* Images.xcassets */, 160 | AB38B9C4186DB4370033AECA /* Supporting Files */, 161 | ); 162 | path = XHDrawerController; 163 | sourceTree = ""; 164 | }; 165 | AB38B9C4186DB4370033AECA /* Supporting Files */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | AB38B9C5186DB4370033AECA /* XHDrawerController-Info.plist */, 169 | AB38B9C6186DB4370033AECA /* InfoPlist.strings */, 170 | AB38B9C9186DB4370033AECA /* main.m */, 171 | AB38B9CB186DB4370033AECA /* XHDrawerController-Prefix.pch */, 172 | ); 173 | name = "Supporting Files"; 174 | sourceTree = ""; 175 | }; 176 | AB38B9E5186DB4380033AECA /* XHDrawerControllerTests */ = { 177 | isa = PBXGroup; 178 | children = ( 179 | AB38B9EB186DB4380033AECA /* XHDrawerControllerTests.m */, 180 | AB38B9E6186DB4380033AECA /* Supporting Files */, 181 | ); 182 | path = XHDrawerControllerTests; 183 | sourceTree = ""; 184 | }; 185 | AB38B9E6186DB4380033AECA /* Supporting Files */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | AB38B9E7186DB4380033AECA /* XHDrawerControllerTests-Info.plist */, 189 | AB38B9E8186DB4380033AECA /* InfoPlist.strings */, 190 | ); 191 | name = "Supporting Files"; 192 | sourceTree = ""; 193 | }; 194 | AB38B9F6186DB4B40033AECA /* Source */ = { 195 | isa = PBXGroup; 196 | children = ( 197 | AB38B9F7186DB4D50033AECA /* XHDrawerController.h */, 198 | AB38B9F8186DB4D50033AECA /* XHDrawerController.m */, 199 | AB38BA0F186DBE820033AECA /* XHZoomDrawerView.h */, 200 | AB38BA10186DBE820033AECA /* XHZoomDrawerView.m */, 201 | AB38BA15186DBFBC0033AECA /* XHDrawerControllerHeader.h */, 202 | ); 203 | name = Source; 204 | path = ../Source; 205 | sourceTree = ""; 206 | }; 207 | AB38BA03186DB5070033AECA /* XHDrawerControllerSDK */ = { 208 | isa = PBXGroup; 209 | children = ( 210 | AB38BA04186DB5070033AECA /* Supporting Files */, 211 | ); 212 | path = XHDrawerControllerSDK; 213 | sourceTree = ""; 214 | }; 215 | AB38BA04186DB5070033AECA /* Supporting Files */ = { 216 | isa = PBXGroup; 217 | children = ( 218 | AB38BA05186DB5070033AECA /* XHDrawerControllerSDK-Info.plist */, 219 | AB38BA06186DB5070033AECA /* InfoPlist.strings */, 220 | AB38BA09186DB5070033AECA /* XHDrawerControllerSDK-Prefix.pch */, 221 | ); 222 | name = "Supporting Files"; 223 | sourceTree = ""; 224 | }; 225 | /* End PBXGroup section */ 226 | 227 | /* Begin PBXHeadersBuildPhase section */ 228 | AB38B9FD186DB5070033AECA /* Headers */ = { 229 | isa = PBXHeadersBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | AB38BA16186DBFBC0033AECA /* XHDrawerControllerHeader.h in Headers */, 233 | AB38BA0E186DB5250033AECA /* XHDrawerController.h in Headers */, 234 | AB38BA11186DBE820033AECA /* XHZoomDrawerView.h in Headers */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXHeadersBuildPhase section */ 239 | 240 | /* Begin PBXNativeTarget section */ 241 | AB38B9B9186DB4370033AECA /* XHDrawerController */ = { 242 | isa = PBXNativeTarget; 243 | buildConfigurationList = AB38B9EF186DB4380033AECA /* Build configuration list for PBXNativeTarget "XHDrawerController" */; 244 | buildPhases = ( 245 | AB38B9B6186DB4370033AECA /* Sources */, 246 | AB38B9B7186DB4370033AECA /* Frameworks */, 247 | AB38B9B8186DB4370033AECA /* Resources */, 248 | ); 249 | buildRules = ( 250 | ); 251 | dependencies = ( 252 | ); 253 | name = XHDrawerController; 254 | productName = XHDrawerController; 255 | productReference = AB38B9BA186DB4370033AECA /* XHDrawerController.app */; 256 | productType = "com.apple.product-type.application"; 257 | }; 258 | AB38B9DD186DB4380033AECA /* XHDrawerControllerTests */ = { 259 | isa = PBXNativeTarget; 260 | buildConfigurationList = AB38B9F2186DB4380033AECA /* Build configuration list for PBXNativeTarget "XHDrawerControllerTests" */; 261 | buildPhases = ( 262 | AB38B9DA186DB4380033AECA /* Sources */, 263 | AB38B9DB186DB4380033AECA /* Frameworks */, 264 | AB38B9DC186DB4380033AECA /* Resources */, 265 | ); 266 | buildRules = ( 267 | ); 268 | dependencies = ( 269 | AB38B9E4186DB4380033AECA /* PBXTargetDependency */, 270 | ); 271 | name = XHDrawerControllerTests; 272 | productName = XHDrawerControllerTests; 273 | productReference = AB38B9DE186DB4380033AECA /* XHDrawerControllerTests.xctest */; 274 | productType = "com.apple.product-type.bundle.unit-test"; 275 | }; 276 | AB38BA01186DB5070033AECA /* XHDrawerControllerSDK */ = { 277 | isa = PBXNativeTarget; 278 | buildConfigurationList = AB38BA0A186DB5070033AECA /* Build configuration list for PBXNativeTarget "XHDrawerControllerSDK" */; 279 | buildPhases = ( 280 | AB38B9FA186DB5070033AECA /* ShellScript */, 281 | AB38B9FB186DB5070033AECA /* Sources */, 282 | AB38B9FC186DB5070033AECA /* Frameworks */, 283 | AB38B9FD186DB5070033AECA /* Headers */, 284 | AB38B9FE186DB5070033AECA /* Resources */, 285 | AB38B9FF186DB5070033AECA /* ShellScript */, 286 | AB38BA00186DB5070033AECA /* ShellScript */, 287 | ); 288 | buildRules = ( 289 | ); 290 | dependencies = ( 291 | ); 292 | name = XHDrawerControllerSDK; 293 | productName = XHDrawerControllerSDK; 294 | productReference = AB38BA02186DB5070033AECA /* XHDrawerControllerSDK.framework */; 295 | productType = "com.apple.product-type.bundle"; 296 | }; 297 | /* End PBXNativeTarget section */ 298 | 299 | /* Begin PBXProject section */ 300 | AB38B9B2186DB4370033AECA /* Project object */ = { 301 | isa = PBXProject; 302 | attributes = { 303 | LastUpgradeCheck = 0500; 304 | ORGANIZATIONNAME = "曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507"; 305 | TargetAttributes = { 306 | AB38B9DD186DB4380033AECA = { 307 | TestTargetID = AB38B9B9186DB4370033AECA; 308 | }; 309 | }; 310 | }; 311 | buildConfigurationList = AB38B9B5186DB4370033AECA /* Build configuration list for PBXProject "XHDrawerController" */; 312 | compatibilityVersion = "Xcode 3.2"; 313 | developmentRegion = English; 314 | hasScannedForEncodings = 0; 315 | knownRegions = ( 316 | en, 317 | Base, 318 | ); 319 | mainGroup = AB38B9B1186DB4370033AECA; 320 | productRefGroup = AB38B9BB186DB4370033AECA /* Products */; 321 | projectDirPath = ""; 322 | projectRoot = ""; 323 | targets = ( 324 | AB38B9B9186DB4370033AECA /* XHDrawerController */, 325 | AB38BA01186DB5070033AECA /* XHDrawerControllerSDK */, 326 | AB38B9DD186DB4380033AECA /* XHDrawerControllerTests */, 327 | ); 328 | }; 329 | /* End PBXProject section */ 330 | 331 | /* Begin PBXResourcesBuildPhase section */ 332 | AB38B9B8186DB4370033AECA /* Resources */ = { 333 | isa = PBXResourcesBuildPhase; 334 | buildActionMask = 2147483647; 335 | files = ( 336 | AB38B9D9186DB4370033AECA /* Images.xcassets in Resources */, 337 | AB38B9C8186DB4370033AECA /* InfoPlist.strings in Resources */, 338 | ); 339 | runOnlyForDeploymentPostprocessing = 0; 340 | }; 341 | AB38B9DC186DB4380033AECA /* Resources */ = { 342 | isa = PBXResourcesBuildPhase; 343 | buildActionMask = 2147483647; 344 | files = ( 345 | AB38B9EA186DB4380033AECA /* InfoPlist.strings in Resources */, 346 | ); 347 | runOnlyForDeploymentPostprocessing = 0; 348 | }; 349 | AB38B9FE186DB5070033AECA /* Resources */ = { 350 | isa = PBXResourcesBuildPhase; 351 | buildActionMask = 2147483647; 352 | files = ( 353 | AB38BA08186DB5070033AECA /* InfoPlist.strings in Resources */, 354 | ); 355 | runOnlyForDeploymentPostprocessing = 0; 356 | }; 357 | /* End PBXResourcesBuildPhase section */ 358 | 359 | /* Begin PBXShellScriptBuildPhase section */ 360 | AB38B9FA186DB5070033AECA /* ShellScript */ = { 361 | isa = PBXShellScriptBuildPhase; 362 | buildActionMask = 2147483647; 363 | files = ( 364 | ); 365 | inputPaths = ( 366 | ); 367 | outputPaths = ( 368 | ); 369 | runOnlyForDeploymentPostprocessing = 0; 370 | shellPath = /bin/sh; 371 | shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n\tUFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Clean other platform if needed\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n\techo \"Platform \\\"$UFW_SDK_PLATFORM\\\" was cleaned recently. Cleaning \\\"$UFW_OTHER_PLATFORM\\\" as well\"\n\techo xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\n\txcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\nfi\n\n\n# Make sure we are building from fresh binaries\n\nrm -rf \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\n"; 372 | }; 373 | AB38B9FF186DB5070033AECA /* ShellScript */ = { 374 | isa = PBXShellScriptBuildPhase; 375 | buildActionMask = 2147483647; 376 | files = ( 377 | ); 378 | inputPaths = ( 379 | ); 380 | outputPaths = ( 381 | ); 382 | runOnlyForDeploymentPostprocessing = 0; 383 | shellPath = /bin/sh; 384 | shellScript = "HEADERS_ROOT=$SRCROOT/$PRODUCT_NAME\nFRAMEWORK_HEADERS_DIR=\"$BUILT_PRODUCTS_DIR/$WRAPPER_NAME/Versions/$FRAMEWORK_VERSION/Headers\"\n\n## only header files expected at this point\nPUBLIC_HEADERS=$(find $FRAMEWORK_HEADERS_DIR/. -not -type d 2> /dev/null | sed -e \"s@.*/@@g\")\n\nFIND_OPTS=\"\"\nfor PUBLIC_HEADER in $PUBLIC_HEADERS; do\n if [ -n \"$FIND_OPTS\" ]; then\n FIND_OPTS=\"$FIND_OPTS -o\"\n fi\n FIND_OPTS=\"$FIND_OPTS -name '$PUBLIC_HEADER'\"\ndone\n\nif [ -n \"$FIND_OPTS\" ]; then\n for ORIG_HEADER in $(eval \"find $HEADERS_ROOT/. $FIND_OPTS\" 2> /dev/null | sed -e \"s@^$HEADERS_ROOT/./@@g\"); do\n PUBLIC_HEADER=$(basename $ORIG_HEADER)\n RELATIVE_PATH=$(dirname $ORIG_HEADER)\n if [ -e $FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER ]; then\n mkdir -p \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH\"\n mv \"$FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER\" \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH/$PUBLIC_HEADER\"\n fi\n done\nfi\n"; 385 | }; 386 | AB38BA00186DB5070033AECA /* ShellScript */ = { 387 | isa = PBXShellScriptBuildPhase; 388 | buildActionMask = 2147483647; 389 | files = ( 390 | ); 391 | inputPaths = ( 392 | ); 393 | outputPaths = ( 394 | ); 395 | runOnlyForDeploymentPostprocessing = 0; 396 | shellPath = /bin/sh; 397 | shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\nexport UFW_MASTER_SCRIPT_RUNNING=1\n\n\n# Functions\n\n## List files in the specified directory, storing to the specified array.\n#\n# @param $1 The path to list\n# @param $2 The name of the array to fill\n#\n##\nlist_files ()\n{\n filelist=$(ls \"$1\")\n while read line\n do\n eval \"$2[\\${#$2[*]}]=\\\"\\$line\\\"\"\n done <<< \"$filelist\"\n}\n\n\n# Sanity check\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n echo \"Framework target \\\"${TARGET_NAME}\\\" had no source files to build from. Make sure your source files have the correct target membership\"\n exit 1\nfi\n\n\n# Gather information\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n UFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date.\n# We already checked the other platform in the prerun script.\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Make sure the other platform gets built\n\necho \"Build other platform\"\n\necho xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\nxcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\n\n\n# Build the fat static library binary\n\necho \"Create universal static library\"\n\nif [[ \"$XCODE_VERSION_MAJOR\" == \"0500\" ]]\nthen\n echo \"$DT_TOOLCHAIN_DIR/usr/bin/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n \"$DT_TOOLCHAIN_DIR/usr/bin/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\nelse\n echo \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\nfi \n\necho mv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nmv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\n\n\n# Build framework structure\n\necho \"Build symlinks\"\n\necho ln -sfh $FRAMEWORK_VERSION \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\nln -sfh $FRAMEWORK_VERSION \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\necho ln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\nln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\necho ln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\nln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\necho ln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\nln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\n\n\n# Link to binary for unit tests\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework\"\nln -sfh \"../${WRAPPER_NAME}/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework/.fake_fw_testing\"\n\n\n# Build embedded framework structure\n\necho \"Build Embedded Framework\"\n\necho rm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\necho mkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\nmkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\necho cp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\ncp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\n\ndeclare -a UFW_FILE_LIST\nlist_files \"${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}\" UFW_FILE_LIST\nfor filename in \"${UFW_FILE_LIST[@]}\"\ndo\n if [[ \"${filename}\" != \"Info.plist\" ]] && [[ ! \"${filename}\" =~ .*\\.lproj$ ]]\n then\n echo ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n fi\ndone\n\n\n# Replace other platform's framework with a copy of this one (so that both have the same universal binary)\n\necho \"Copy from $UFW_SDK_PLATFORM to $UFW_OTHER_PLATFORM\"\n\necho rm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\nrm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\necho cp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\ncp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\n"; 398 | }; 399 | /* End PBXShellScriptBuildPhase section */ 400 | 401 | /* Begin PBXSourcesBuildPhase section */ 402 | AB38B9B6186DB4370033AECA /* Sources */ = { 403 | isa = PBXSourcesBuildPhase; 404 | buildActionMask = 2147483647; 405 | files = ( 406 | AB38BA1F186DDA920033AECA /* XHExampleRightSideDrawerViewController.m in Sources */, 407 | AB38BA1C186DDA840033AECA /* XHExampleLeftSideDrawerViewController.m in Sources */, 408 | AB38BA22186DDB260033AECA /* XHExampleCenterSideDrawerViewController.m in Sources */, 409 | AB38B9F9186DB4D50033AECA /* XHDrawerController.m in Sources */, 410 | AB38B9CE186DB4370033AECA /* AppDelegate.m in Sources */, 411 | AB38BA12186DBE820033AECA /* XHZoomDrawerView.m in Sources */, 412 | AB38BA19186DDA6B0033AECA /* XHExampleSideDrawerViewController.m in Sources */, 413 | AB38B9CA186DB4370033AECA /* main.m in Sources */, 414 | ); 415 | runOnlyForDeploymentPostprocessing = 0; 416 | }; 417 | AB38B9DA186DB4380033AECA /* Sources */ = { 418 | isa = PBXSourcesBuildPhase; 419 | buildActionMask = 2147483647; 420 | files = ( 421 | AB38B9EC186DB4380033AECA /* XHDrawerControllerTests.m in Sources */, 422 | ); 423 | runOnlyForDeploymentPostprocessing = 0; 424 | }; 425 | AB38B9FB186DB5070033AECA /* Sources */ = { 426 | isa = PBXSourcesBuildPhase; 427 | buildActionMask = 2147483647; 428 | files = ( 429 | AB38BA13186DBE820033AECA /* XHZoomDrawerView.m in Sources */, 430 | AB38BA0D186DB5140033AECA /* XHDrawerController.m in Sources */, 431 | ); 432 | runOnlyForDeploymentPostprocessing = 0; 433 | }; 434 | /* End PBXSourcesBuildPhase section */ 435 | 436 | /* Begin PBXTargetDependency section */ 437 | AB38B9E4186DB4380033AECA /* PBXTargetDependency */ = { 438 | isa = PBXTargetDependency; 439 | target = AB38B9B9186DB4370033AECA /* XHDrawerController */; 440 | targetProxy = AB38B9E3186DB4380033AECA /* PBXContainerItemProxy */; 441 | }; 442 | /* End PBXTargetDependency section */ 443 | 444 | /* Begin PBXVariantGroup section */ 445 | AB38B9C6186DB4370033AECA /* InfoPlist.strings */ = { 446 | isa = PBXVariantGroup; 447 | children = ( 448 | AB38B9C7186DB4370033AECA /* en */, 449 | ); 450 | name = InfoPlist.strings; 451 | sourceTree = ""; 452 | }; 453 | AB38B9E8186DB4380033AECA /* InfoPlist.strings */ = { 454 | isa = PBXVariantGroup; 455 | children = ( 456 | AB38B9E9186DB4380033AECA /* en */, 457 | ); 458 | name = InfoPlist.strings; 459 | sourceTree = ""; 460 | }; 461 | AB38BA06186DB5070033AECA /* InfoPlist.strings */ = { 462 | isa = PBXVariantGroup; 463 | children = ( 464 | AB38BA07186DB5070033AECA /* en */, 465 | ); 466 | name = InfoPlist.strings; 467 | sourceTree = ""; 468 | }; 469 | /* End PBXVariantGroup section */ 470 | 471 | /* Begin XCBuildConfiguration section */ 472 | AB38B9ED186DB4380033AECA /* Debug */ = { 473 | isa = XCBuildConfiguration; 474 | buildSettings = { 475 | ALWAYS_SEARCH_USER_PATHS = NO; 476 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 477 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 478 | CLANG_CXX_LIBRARY = "libc++"; 479 | CLANG_ENABLE_MODULES = YES; 480 | CLANG_ENABLE_OBJC_ARC = YES; 481 | CLANG_WARN_BOOL_CONVERSION = YES; 482 | CLANG_WARN_CONSTANT_CONVERSION = YES; 483 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 484 | CLANG_WARN_EMPTY_BODY = YES; 485 | CLANG_WARN_ENUM_CONVERSION = YES; 486 | CLANG_WARN_INT_CONVERSION = YES; 487 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 488 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 489 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 490 | COPY_PHASE_STRIP = NO; 491 | GCC_C_LANGUAGE_STANDARD = gnu99; 492 | GCC_DYNAMIC_NO_PIC = NO; 493 | GCC_OPTIMIZATION_LEVEL = 0; 494 | GCC_PREPROCESSOR_DEFINITIONS = ( 495 | "DEBUG=1", 496 | "$(inherited)", 497 | ); 498 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 499 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 500 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 501 | GCC_WARN_UNDECLARED_SELECTOR = YES; 502 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 503 | GCC_WARN_UNUSED_FUNCTION = YES; 504 | GCC_WARN_UNUSED_VARIABLE = YES; 505 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 506 | ONLY_ACTIVE_ARCH = YES; 507 | SDKROOT = iphoneos; 508 | TARGETED_DEVICE_FAMILY = "1,2"; 509 | }; 510 | name = Debug; 511 | }; 512 | AB38B9EE186DB4380033AECA /* Release */ = { 513 | isa = XCBuildConfiguration; 514 | buildSettings = { 515 | ALWAYS_SEARCH_USER_PATHS = NO; 516 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 517 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 518 | CLANG_CXX_LIBRARY = "libc++"; 519 | CLANG_ENABLE_MODULES = YES; 520 | CLANG_ENABLE_OBJC_ARC = YES; 521 | CLANG_WARN_BOOL_CONVERSION = YES; 522 | CLANG_WARN_CONSTANT_CONVERSION = YES; 523 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 524 | CLANG_WARN_EMPTY_BODY = YES; 525 | CLANG_WARN_ENUM_CONVERSION = YES; 526 | CLANG_WARN_INT_CONVERSION = YES; 527 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 528 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 529 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 530 | COPY_PHASE_STRIP = YES; 531 | ENABLE_NS_ASSERTIONS = NO; 532 | GCC_C_LANGUAGE_STANDARD = gnu99; 533 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 534 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 535 | GCC_WARN_UNDECLARED_SELECTOR = YES; 536 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 537 | GCC_WARN_UNUSED_FUNCTION = YES; 538 | GCC_WARN_UNUSED_VARIABLE = YES; 539 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 540 | SDKROOT = iphoneos; 541 | TARGETED_DEVICE_FAMILY = "1,2"; 542 | VALIDATE_PRODUCT = YES; 543 | }; 544 | name = Release; 545 | }; 546 | AB38B9F0186DB4380033AECA /* Debug */ = { 547 | isa = XCBuildConfiguration; 548 | buildSettings = { 549 | ARCHS = "$(ARCHS_STANDARD)"; 550 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 551 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 552 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 553 | GCC_PREFIX_HEADER = "XHDrawerController/XHDrawerController-Prefix.pch"; 554 | INFOPLIST_FILE = "XHDrawerController/XHDrawerController-Info.plist"; 555 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 556 | PRODUCT_NAME = "$(TARGET_NAME)"; 557 | WRAPPER_EXTENSION = app; 558 | }; 559 | name = Debug; 560 | }; 561 | AB38B9F1186DB4380033AECA /* Release */ = { 562 | isa = XCBuildConfiguration; 563 | buildSettings = { 564 | ARCHS = "$(ARCHS_STANDARD)"; 565 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 566 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 567 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 568 | GCC_PREFIX_HEADER = "XHDrawerController/XHDrawerController-Prefix.pch"; 569 | INFOPLIST_FILE = "XHDrawerController/XHDrawerController-Info.plist"; 570 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 571 | PRODUCT_NAME = "$(TARGET_NAME)"; 572 | WRAPPER_EXTENSION = app; 573 | }; 574 | name = Release; 575 | }; 576 | AB38B9F3186DB4380033AECA /* Debug */ = { 577 | isa = XCBuildConfiguration; 578 | buildSettings = { 579 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 580 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/XHDrawerController.app/XHDrawerController"; 581 | FRAMEWORK_SEARCH_PATHS = ( 582 | "$(SDKROOT)/Developer/Library/Frameworks", 583 | "$(inherited)", 584 | "$(DEVELOPER_FRAMEWORKS_DIR)", 585 | ); 586 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 587 | GCC_PREFIX_HEADER = "XHDrawerController/XHDrawerController-Prefix.pch"; 588 | GCC_PREPROCESSOR_DEFINITIONS = ( 589 | "DEBUG=1", 590 | "$(inherited)", 591 | ); 592 | INFOPLIST_FILE = "XHDrawerControllerTests/XHDrawerControllerTests-Info.plist"; 593 | PRODUCT_NAME = "$(TARGET_NAME)"; 594 | TEST_HOST = "$(BUNDLE_LOADER)"; 595 | WRAPPER_EXTENSION = xctest; 596 | }; 597 | name = Debug; 598 | }; 599 | AB38B9F4186DB4380033AECA /* Release */ = { 600 | isa = XCBuildConfiguration; 601 | buildSettings = { 602 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 603 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/XHDrawerController.app/XHDrawerController"; 604 | FRAMEWORK_SEARCH_PATHS = ( 605 | "$(SDKROOT)/Developer/Library/Frameworks", 606 | "$(inherited)", 607 | "$(DEVELOPER_FRAMEWORKS_DIR)", 608 | ); 609 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 610 | GCC_PREFIX_HEADER = "XHDrawerController/XHDrawerController-Prefix.pch"; 611 | INFOPLIST_FILE = "XHDrawerControllerTests/XHDrawerControllerTests-Info.plist"; 612 | PRODUCT_NAME = "$(TARGET_NAME)"; 613 | TEST_HOST = "$(BUNDLE_LOADER)"; 614 | WRAPPER_EXTENSION = xctest; 615 | }; 616 | name = Release; 617 | }; 618 | AB38BA0B186DB5070033AECA /* Debug */ = { 619 | isa = XCBuildConfiguration; 620 | buildSettings = { 621 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 622 | CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)"; 623 | DEAD_CODE_STRIPPING = NO; 624 | DYLIB_COMPATIBILITY_VERSION = 1; 625 | DYLIB_CURRENT_VERSION = 1; 626 | FRAMEWORK_VERSION = A; 627 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 628 | GCC_PREFIX_HEADER = "XHDrawerControllerSDK/XHDrawerControllerSDK-Prefix.pch"; 629 | GCC_PREPROCESSOR_DEFINITIONS = ( 630 | "DEBUG=1", 631 | "$(inherited)", 632 | ); 633 | INFOPLIST_FILE = "XHDrawerControllerSDK/XHDrawerControllerSDK-Info.plist"; 634 | INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; 635 | INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; 636 | LINK_WITH_STANDARD_LIBRARIES = NO; 637 | MACH_O_TYPE = mh_object; 638 | PRODUCT_NAME = "$(TARGET_NAME)"; 639 | SKIP_INSTALL = YES; 640 | UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; 641 | WRAPPER_EXTENSION = framework; 642 | }; 643 | name = Debug; 644 | }; 645 | AB38BA0C186DB5070033AECA /* Release */ = { 646 | isa = XCBuildConfiguration; 647 | buildSettings = { 648 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 649 | CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)"; 650 | DEAD_CODE_STRIPPING = NO; 651 | DYLIB_COMPATIBILITY_VERSION = 1; 652 | DYLIB_CURRENT_VERSION = 1; 653 | FRAMEWORK_VERSION = A; 654 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 655 | GCC_PREFIX_HEADER = "XHDrawerControllerSDK/XHDrawerControllerSDK-Prefix.pch"; 656 | INFOPLIST_FILE = "XHDrawerControllerSDK/XHDrawerControllerSDK-Info.plist"; 657 | INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; 658 | INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; 659 | LINK_WITH_STANDARD_LIBRARIES = NO; 660 | MACH_O_TYPE = mh_object; 661 | PRODUCT_NAME = "$(TARGET_NAME)"; 662 | SKIP_INSTALL = YES; 663 | UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; 664 | WRAPPER_EXTENSION = framework; 665 | }; 666 | name = Release; 667 | }; 668 | /* End XCBuildConfiguration section */ 669 | 670 | /* Begin XCConfigurationList section */ 671 | AB38B9B5186DB4370033AECA /* Build configuration list for PBXProject "XHDrawerController" */ = { 672 | isa = XCConfigurationList; 673 | buildConfigurations = ( 674 | AB38B9ED186DB4380033AECA /* Debug */, 675 | AB38B9EE186DB4380033AECA /* Release */, 676 | ); 677 | defaultConfigurationIsVisible = 0; 678 | defaultConfigurationName = Release; 679 | }; 680 | AB38B9EF186DB4380033AECA /* Build configuration list for PBXNativeTarget "XHDrawerController" */ = { 681 | isa = XCConfigurationList; 682 | buildConfigurations = ( 683 | AB38B9F0186DB4380033AECA /* Debug */, 684 | AB38B9F1186DB4380033AECA /* Release */, 685 | ); 686 | defaultConfigurationIsVisible = 0; 687 | defaultConfigurationName = Release; 688 | }; 689 | AB38B9F2186DB4380033AECA /* Build configuration list for PBXNativeTarget "XHDrawerControllerTests" */ = { 690 | isa = XCConfigurationList; 691 | buildConfigurations = ( 692 | AB38B9F3186DB4380033AECA /* Debug */, 693 | AB38B9F4186DB4380033AECA /* Release */, 694 | ); 695 | defaultConfigurationIsVisible = 0; 696 | defaultConfigurationName = Release; 697 | }; 698 | AB38BA0A186DB5070033AECA /* Build configuration list for PBXNativeTarget "XHDrawerControllerSDK" */ = { 699 | isa = XCConfigurationList; 700 | buildConfigurations = ( 701 | AB38BA0B186DB5070033AECA /* Debug */, 702 | AB38BA0C186DB5070033AECA /* Release */, 703 | ); 704 | defaultConfigurationIsVisible = 0; 705 | defaultConfigurationName = Release; 706 | }; 707 | /* End XCConfigurationList section */ 708 | }; 709 | rootObject = AB38B9B2186DB4370033AECA /* Project object */; 710 | } 711 | -------------------------------------------------------------------------------- /Project/XHDrawerController.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Project/XHDrawerController/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Project/XHDrawerController/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "XHExampleLeftSideDrawerViewController.h" 11 | #import "XHExampleRightSideDrawerViewController.h" 12 | #import "XHExampleCenterSideDrawerViewController.h" 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | // Override point for customization after application launch. 19 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 20 | self.window.backgroundColor = [UIColor whiteColor]; 21 | 22 | XHDrawerController *drawerController = [[XHDrawerController alloc] init]; 23 | drawerController.springAnimationOn = YES; 24 | 25 | XHExampleLeftSideDrawerViewController *leftSideDrawerViewController = [[XHExampleLeftSideDrawerViewController alloc] init]; 26 | 27 | XHExampleRightSideDrawerViewController *rightSideDrawerViewController = [[XHExampleRightSideDrawerViewController alloc] init]; 28 | 29 | XHExampleCenterSideDrawerViewController *centerSideDrawerViewController = [[XHExampleCenterSideDrawerViewController alloc] init]; 30 | 31 | drawerController.leftViewController = leftSideDrawerViewController; 32 | drawerController.rightViewController = rightSideDrawerViewController; 33 | drawerController.centerViewController = [[UINavigationController alloc] initWithRootViewController:centerSideDrawerViewController]; 34 | 35 | UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"MenuBackground"]]; 36 | [backgroundImageView setContentMode:UIViewContentModeCenter]; 37 | drawerController.backgroundView = backgroundImageView; 38 | 39 | 40 | self.window.rootViewController = drawerController; 41 | 42 | [self.window makeKeyAndVisible]; 43 | 44 | return YES; 45 | } 46 | 47 | - (void)applicationWillResignActive:(UIApplication *)application 48 | { 49 | // 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. 50 | // 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. 51 | } 52 | 53 | - (void)applicationDidEnterBackground:(UIApplication *)application 54 | { 55 | // 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. 56 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 57 | } 58 | 59 | - (void)applicationWillEnterForeground:(UIApplication *)application 60 | { 61 | // 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. 62 | } 63 | 64 | - (void)applicationDidBecomeActive:(UIApplication *)application 65 | { 66 | // 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. 67 | } 68 | 69 | - (void)applicationWillTerminate:(UIApplication *)application 70 | { 71 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /Project/XHDrawerController/Images.xcassets/AppIcon.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHDrawerController/a821af2e3f4ffb2f6715ab0bdaf7b80418af23dc/Project/XHDrawerController/Images.xcassets/AppIcon.appiconset/120.png -------------------------------------------------------------------------------- /Project/XHDrawerController/Images.xcassets/AppIcon.appiconset/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHDrawerController/a821af2e3f4ffb2f6715ab0bdaf7b80418af23dc/Project/XHDrawerController/Images.xcassets/AppIcon.appiconset/152.png -------------------------------------------------------------------------------- /Project/XHDrawerController/Images.xcassets/AppIcon.appiconset/72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHDrawerController/a821af2e3f4ffb2f6715ab0bdaf7b80418af23dc/Project/XHDrawerController/Images.xcassets/AppIcon.appiconset/72.png -------------------------------------------------------------------------------- /Project/XHDrawerController/Images.xcassets/AppIcon.appiconset/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHDrawerController/a821af2e3f4ffb2f6715ab0bdaf7b80418af23dc/Project/XHDrawerController/Images.xcassets/AppIcon.appiconset/76.png -------------------------------------------------------------------------------- /Project/XHDrawerController/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "size" : "40x40", 10 | "idiom" : "iphone", 11 | "filename" : "72.png", 12 | "scale" : "2x" 13 | }, 14 | { 15 | "size" : "60x60", 16 | "idiom" : "iphone", 17 | "filename" : "120.png", 18 | "scale" : "2x" 19 | }, 20 | { 21 | "idiom" : "ipad", 22 | "size" : "29x29", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "idiom" : "ipad", 27 | "size" : "29x29", 28 | "scale" : "2x" 29 | }, 30 | { 31 | "idiom" : "ipad", 32 | "size" : "40x40", 33 | "scale" : "1x" 34 | }, 35 | { 36 | "idiom" : "ipad", 37 | "size" : "40x40", 38 | "scale" : "2x" 39 | }, 40 | { 41 | "size" : "76x76", 42 | "idiom" : "ipad", 43 | "filename" : "76.png", 44 | "scale" : "1x" 45 | }, 46 | { 47 | "size" : "76x76", 48 | "idiom" : "ipad", 49 | "filename" : "152.png", 50 | "scale" : "2x" 51 | } 52 | ], 53 | "info" : { 54 | "version" : 1, 55 | "author" : "xcode" 56 | } 57 | } -------------------------------------------------------------------------------- /Project/XHDrawerController/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "filename" : "Default@2x.png", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "extent" : "full-screen", 13 | "idiom" : "iphone", 14 | "subtype" : "retina4", 15 | "filename" : "Default-568h@2x.png", 16 | "minimum-system-version" : "7.0", 17 | "orientation" : "portrait", 18 | "scale" : "2x" 19 | }, 20 | { 21 | "orientation" : "portrait", 22 | "idiom" : "ipad", 23 | "extent" : "full-screen", 24 | "minimum-system-version" : "7.0", 25 | "filename" : "Default-Portrait.png", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "orientation" : "landscape", 30 | "idiom" : "ipad", 31 | "extent" : "full-screen", 32 | "minimum-system-version" : "7.0", 33 | "scale" : "1x" 34 | }, 35 | { 36 | "orientation" : "portrait", 37 | "idiom" : "ipad", 38 | "extent" : "full-screen", 39 | "minimum-system-version" : "7.0", 40 | "filename" : "Default-Portrait@2x.png", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "orientation" : "landscape", 45 | "idiom" : "ipad", 46 | "extent" : "full-screen", 47 | "minimum-system-version" : "7.0", 48 | "scale" : "2x" 49 | } 50 | ], 51 | "info" : { 52 | "version" : 1, 53 | "author" : "xcode" 54 | } 55 | } -------------------------------------------------------------------------------- /Project/XHDrawerController/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHDrawerController/a821af2e3f4ffb2f6715ab0bdaf7b80418af23dc/Project/XHDrawerController/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /Project/XHDrawerController/Images.xcassets/LaunchImage.launchimage/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHDrawerController/a821af2e3f4ffb2f6715ab0bdaf7b80418af23dc/Project/XHDrawerController/Images.xcassets/LaunchImage.launchimage/Default-Portrait.png -------------------------------------------------------------------------------- /Project/XHDrawerController/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHDrawerController/a821af2e3f4ffb2f6715ab0bdaf7b80418af23dc/Project/XHDrawerController/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png -------------------------------------------------------------------------------- /Project/XHDrawerController/Images.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHDrawerController/a821af2e3f4ffb2f6715ab0bdaf7b80418af23dc/Project/XHDrawerController/Images.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /Project/XHDrawerController/Images.xcassets/MenuBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "MenuBackground@2x.png" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /Project/XHDrawerController/Images.xcassets/MenuBackground.imageset/MenuBackground@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHDrawerController/a821af2e3f4ffb2f6715ab0bdaf7b80418af23dc/Project/XHDrawerController/Images.xcassets/MenuBackground.imageset/MenuBackground@2x.png -------------------------------------------------------------------------------- /Project/XHDrawerController/Images.xcassets/me.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "未标题-1.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /Project/XHDrawerController/Images.xcassets/me.imageset/未标题-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHDrawerController/a821af2e3f4ffb2f6715ab0bdaf7b80418af23dc/Project/XHDrawerController/Images.xcassets/me.imageset/未标题-1.png -------------------------------------------------------------------------------- /Project/XHDrawerController/XHDrawerController-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.JackTeam.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | 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 | -------------------------------------------------------------------------------- /Project/XHDrawerController/XHDrawerController-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | 17 | #import "XHDrawerController.h" 18 | #endif 19 | -------------------------------------------------------------------------------- /Project/XHDrawerController/XHExampleCenterSideDrawerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHExampleCenterSideDrawerViewController.h 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHExampleSideDrawerViewController.h" 10 | 11 | @interface XHExampleCenterSideDrawerViewController : XHExampleSideDrawerViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Project/XHDrawerController/XHExampleCenterSideDrawerViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHExampleCenterSideDrawerViewController.m 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHExampleCenterSideDrawerViewController.h" 10 | 11 | @interface XHExampleCenterSideDrawerViewController () 12 | 13 | @end 14 | 15 | @implementation XHExampleCenterSideDrawerViewController 16 | 17 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 18 | { 19 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 20 | if (self) { 21 | // Custom initialization 22 | } 23 | return self; 24 | } 25 | 26 | - (void)viewDidLoad 27 | { 28 | [super viewDidLoad]; 29 | // Do any additional setup after loading the view. 30 | self.view.backgroundColor = [UIColor grayColor]; 31 | UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.view.bounds]; 32 | imageView.contentMode = UIViewContentModeScaleAspectFill; 33 | imageView.image = [UIImage imageNamed:@"me"]; 34 | [self.view addSubview:imageView]; 35 | } 36 | 37 | - (void)didReceiveMemoryWarning 38 | { 39 | [super didReceiveMemoryWarning]; 40 | // Dispose of any resources that can be recreated. 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Project/XHDrawerController/XHExampleLeftSideDrawerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHExampleLeftSideDrawerViewController.h 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHExampleSideDrawerViewController.h" 10 | 11 | @interface XHExampleLeftSideDrawerViewController : XHExampleSideDrawerViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Project/XHDrawerController/XHExampleLeftSideDrawerViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHExampleLeftSideDrawerViewController.m 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHExampleLeftSideDrawerViewController.h" 10 | 11 | @interface XHExampleLeftSideDrawerViewController () 12 | 13 | @end 14 | 15 | @implementation XHExampleLeftSideDrawerViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view. 21 | CGRect tableViewFrame = self.tableView.frame; 22 | tableViewFrame.origin.y = 95; 23 | tableViewFrame.size.height = 377; 24 | self.tableView.frame = tableViewFrame; 25 | [self.view addSubview:self.tableView]; 26 | // test github 27 | } 28 | 29 | - (void)didReceiveMemoryWarning 30 | { 31 | [super didReceiveMemoryWarning]; 32 | // Dispose of any resources that can be recreated. 33 | } 34 | 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Project/XHDrawerController/XHExampleRightSideDrawerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHExampleRightSideDrawerViewController.h 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHExampleSideDrawerViewController.h" 10 | 11 | @interface XHExampleRightSideDrawerViewController : XHExampleSideDrawerViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Project/XHDrawerController/XHExampleRightSideDrawerViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHExampleRightSideDrawerViewController.m 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHExampleRightSideDrawerViewController.h" 10 | 11 | @interface XHExampleRightSideDrawerViewController () 12 | 13 | @end 14 | 15 | @implementation XHExampleRightSideDrawerViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view. 21 | CGRect tableViewFrame = self.tableView.frame; 22 | tableViewFrame.origin.y = 95; 23 | tableViewFrame.size.height = 377; 24 | self.tableView.frame = tableViewFrame; 25 | [self.view addSubview:self.tableView]; 26 | } 27 | 28 | - (void)didReceiveMemoryWarning 29 | { 30 | [super didReceiveMemoryWarning]; 31 | // Dispose of any resources that can be recreated. 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Project/XHDrawerController/XHExampleSideDrawerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHExampleSideDrawerViewController.h 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHExampleSideDrawerViewController : UIViewController 12 | @property (nonatomic, strong) UITableView *tableView; 13 | @property (nonatomic,strong) NSArray *dataSource; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Project/XHDrawerController/XHExampleSideDrawerViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHExampleSideDrawerViewController.m 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHExampleSideDrawerViewController.h" 10 | #import "XHExampleCenterSideDrawerViewController.h" 11 | 12 | @interface XHExampleSideDrawerViewController () 13 | 14 | @end 15 | 16 | @implementation XHExampleSideDrawerViewController 17 | 18 | - (UITableView *)tableView { 19 | if (!_tableView) { 20 | _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain]; 21 | _tableView.backgroundColor = [UIColor clearColor]; 22 | _tableView.delegate = self; 23 | _tableView.dataSource = self; 24 | _tableView.separatorColor = [UIColor clearColor]; 25 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 26 | } 27 | return _tableView; 28 | } 29 | 30 | - (void)left { 31 | [self.drawerController toggleDrawerSide:XHDrawerSideLeft animated:YES completion:NULL]; 32 | } 33 | 34 | - (void)right { 35 | [self.drawerController toggleDrawerSide:XHDrawerSideRight animated:YES completion:^(BOOL finished) { 36 | 37 | }]; 38 | } 39 | 40 | - (void)viewDidLoad 41 | { 42 | [super viewDidLoad]; 43 | // Do any additional setup after loading the view. 44 | self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Left", @"") style:UIBarButtonItemStyleBordered target:self action:@selector(left)]; 45 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Right", @"") style:UIBarButtonItemStyleBordered target:self action:@selector(right)]; 46 | } 47 | 48 | - (id)init { 49 | self = [super init]; 50 | if (self) { 51 | [self setDataSource:@[@"Option One", @"Option Two", @"Option Three", @"Option Four", @"Option Five"]]; 52 | } 53 | return self; 54 | } 55 | 56 | - (void)didReceiveMemoryWarning 57 | { 58 | [super didReceiveMemoryWarning]; 59 | // Dispose of any resources that can be recreated. 60 | } 61 | 62 | #pragma mark - UITableViewDatasource Methods 63 | 64 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 65 | { 66 | return 1; 67 | } 68 | 69 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 70 | { 71 | return [[self dataSource] count]; 72 | } 73 | 74 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 75 | static NSString *cellIdentifier = @"cellIdentifier"; 76 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 77 | if (!cell) { 78 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; 79 | } 80 | [cell setBackgroundColor:[UIColor clearColor]]; 81 | [[cell textLabel] setTextColor:[UIColor whiteColor]]; 82 | [[cell textLabel] setText:[self dataSource][[indexPath row]]]; 83 | [cell setSelectedBackgroundView:[UIView new]]; 84 | [[cell textLabel] setHighlightedTextColor:[UIColor purpleColor]]; 85 | return cell; 86 | } 87 | 88 | #pragma mark - UITableViewDelegate Methods 89 | 90 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 91 | { 92 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 93 | 94 | XHExampleCenterSideDrawerViewController *centerViewController = [[XHExampleCenterSideDrawerViewController alloc] init]; 95 | [[centerViewController navigationItem] setTitle:[self dataSource][[indexPath row]]]; 96 | UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:centerViewController]; 97 | self.drawerController.centerViewController = navigationController; 98 | [self.drawerController closeDrawerAnimated:YES completion:^(BOOL finished) { 99 | 100 | }]; 101 | } 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /Project/XHDrawerController/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Project/XHDrawerController/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Project/XHDrawerControllerSDK/XHDrawerControllerSDK-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.JackTeam.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Project/XHDrawerControllerSDK/XHDrawerControllerSDK-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /Project/XHDrawerControllerSDK/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Project/XHDrawerControllerTests/XHDrawerControllerTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.JackTeam.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Project/XHDrawerControllerTests/XHDrawerControllerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHDrawerControllerTests.m 3 | // XHDrawerControllerTests 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHDrawerControllerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation XHDrawerControllerTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Project/XHDrawerControllerTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | XHDrawerController 2 | ================== 3 | 4 | 模仿网易新闻的主页框架,左右滑动(带缩放功能),左右滑动主页里面的TableView支持滑动最左边或者右边触发Drawer Left Drawer Right的动画效果 5 | 6 | 7 | ![image](https://github.com/JackTeam/XHDrawerController/raw/master/Screenshots/XHDrawerController.gif) 8 | 9 | 10 | 11 | ## Thanks 12 | [willowtreeapps](https://github.com/willowtreeapps) 13 | 14 | 15 | ## License 16 | 17 | 中文: XHDrawerController 是在MIT协议下使用的,可以在LICENSE文件里面找到相关的使用协议信息. 18 | 19 | English: XHDrawerController is acailable under the MIT license, see the LICENSE file for more information. 20 | 21 | 22 | 23 | ======================= 24 | ## 须知 25 | 中文:如果您在您的项目中使用开源组件,请给我们发[电子邮件](mailto:xhzengAIB@gmail.com?subject=From%20GitHub%20XHDrawerController)告诉我们您的应用程序的名称。 26 | 27 | ## Instructions 28 | 29 | English:If you use open source components in your project, please [Email us](mailto:xhzengAIB@gmail.com?subject=From%20GitHub%20XHDrawerController) to tell us the name of your application. 30 | -------------------------------------------------------------------------------- /Screenshots/XHDrawerController.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHDrawerController/a821af2e3f4ffb2f6715ab0bdaf7b80418af23dc/Screenshots/XHDrawerController.gif -------------------------------------------------------------------------------- /Source/XHDrawerController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHDrawerController.h 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSInteger, XHDrawerSide){ 12 | XHDrawerSideNone = 0, 13 | XHDrawerSideLeft, 14 | XHDrawerSideRight, 15 | }; 16 | 17 | 18 | @interface XHDrawerController : UIViewController 19 | 20 | @property (nonatomic, assign, readonly) XHDrawerSide openSide; 21 | 22 | @property (nonatomic, assign) CGFloat animateDuration; 23 | @property (nonatomic, assign) CGFloat animationDampingDuration; 24 | @property (nonatomic, assign) CGFloat animationVelocity; 25 | @property (nonatomic, strong) UIViewController *centerViewController; 26 | @property (nonatomic, strong) UIViewController *leftViewController; 27 | @property (nonatomic, strong) UIViewController *rightViewController; 28 | @property (nonatomic, strong) UIView *backgroundView; 29 | @property (nonatomic, assign, getter = isSpringAnimationOn) BOOL springAnimationOn; 30 | 31 | - (void)toggleDrawerSide:(XHDrawerSide)drawerSide animated:(BOOL)animated completion:(void(^)(BOOL finished))completion; 32 | 33 | - (void)closeDrawerAnimated:(BOOL)animated completion:(void(^)(BOOL finished))completion; 34 | 35 | - (void)openDrawerSide:(XHDrawerSide)drawerSide animated:(BOOL)animated completion:(void(^)(BOOL finished))completion; 36 | 37 | @end 38 | 39 | 40 | @interface UIViewController (XHDrawerController) 41 | 42 | @property (nonatomic, readonly) XHDrawerController *drawerController; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Source/XHDrawerController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHDrawerController.m 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHDrawerController.h" 10 | #import "XHZoomDrawerView.h" 11 | #import "XHDrawerControllerHeader.h" 12 | 13 | #import 14 | 15 | static const CGFloat XHAnimateDuration = 0.3f; 16 | static const CGFloat XHAnimationDampingDuration = 0.5f; 17 | static const CGFloat XHAnimationVelocity = 20.f; 18 | 19 | 20 | const char *XHDrawerControllerKey = "XHDrawerControllerKey"; 21 | 22 | typedef enum ScrollDirection { 23 | ScrollDirectionNone, 24 | ScrollDirectionRight, 25 | ScrollDirectionLeft, 26 | ScrollDirectionUp, 27 | ScrollDirectionDown, 28 | ScrollDirectionCrazy, 29 | } ScrollDirection; 30 | 31 | @implementation UIViewController (XHDrawerController) 32 | 33 | - (XHDrawerController *)drawerController { 34 | XHDrawerController *panDrawerController = objc_getAssociatedObject(self, &XHDrawerControllerKey); 35 | if (!panDrawerController) { 36 | panDrawerController = self.parentViewController.drawerController; 37 | } 38 | 39 | return panDrawerController; 40 | } 41 | 42 | 43 | - (void)setDrawerController:(XHDrawerController *)drawerController { 44 | objc_setAssociatedObject(self, &XHDrawerControllerKey, drawerController, OBJC_ASSOCIATION_ASSIGN); 45 | } 46 | 47 | @end 48 | 49 | 50 | @interface XHDrawerController () 51 | @property (nonatomic, assign, readwrite) XHDrawerSide openSide; 52 | 53 | @property (nonatomic, strong) XHZoomDrawerView *zoomDrawerView; 54 | 55 | @property (nonatomic, readonly) UIScrollView *scrollView; 56 | 57 | @property (nonatomic, assign) NSInteger cuurrentContentOffsetX; 58 | @end 59 | 60 | @implementation XHDrawerController 61 | 62 | #pragma mark - UIViewController Overrides 63 | 64 | - (void)_setup { 65 | self.animateDuration = XHAnimateDuration; 66 | self.animationDampingDuration = XHAnimationDampingDuration; 67 | self.animationVelocity = XHAnimationVelocity; 68 | self.openSide = XHDrawerSideNone; 69 | } 70 | 71 | - (id)init { 72 | self = [super init]; 73 | if (self) { 74 | [self _setup]; 75 | } 76 | return self; 77 | } 78 | 79 | - (void)loadView { 80 | _zoomDrawerView = [[XHZoomDrawerView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 81 | self.zoomDrawerView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; 82 | self.zoomDrawerView.autoresizesSubviews = YES; 83 | self.view = self.zoomDrawerView; 84 | } 85 | 86 | - (void)viewDidLoad { 87 | [super viewDidLoad]; 88 | if ([self respondsToSelector:@selector(automaticallyAdjustsScrollViewInsets)]) 89 | self.automaticallyAdjustsScrollViewInsets = NO; 90 | self.zoomDrawerView.scrollView.delegate = self; 91 | self.zoomDrawerView.contentContainerButton.userInteractionEnabled = NO; 92 | [self.zoomDrawerView.contentContainerButton addTarget:self action:@selector(contentContainerButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; 93 | } 94 | 95 | 96 | - (void)didReceiveMemoryWarning { 97 | [super didReceiveMemoryWarning]; 98 | // Dispose of any resources that can be recreated. 99 | } 100 | 101 | #pragma mark - Open/Close methods 102 | 103 | - (void)toggleDrawerSide:(XHDrawerSide)drawerSide animated:(BOOL)animated completion:(void (^)(BOOL finished))completion { 104 | NSParameterAssert(drawerSide != XHDrawerSideNone); 105 | if(self.openSide == XHDrawerSideNone){ 106 | [self openDrawerSide:drawerSide animated:animated completion:completion]; 107 | } else { 108 | if((drawerSide == XHDrawerSideLeft && 109 | self.openSide == XHDrawerSideLeft) || 110 | (drawerSide == XHDrawerSideRight && 111 | self.openSide == XHDrawerSideRight)){ 112 | [self closeDrawerAnimated:animated completion:completion]; 113 | } 114 | else if(completion) { 115 | completion(NO); 116 | } 117 | } 118 | } 119 | 120 | - (void)closeDrawerAnimated:(BOOL)animated completion:(void (^)(BOOL finished))completion { 121 | [self closeDrawerAnimated:animated velocity:self.animationVelocity animationOptions:UIViewAnimationOptionCurveEaseInOut completion:completion]; 122 | } 123 | 124 | - (void)closeDrawerAnimated:(BOOL)animated velocity:(CGFloat)velocity animationOptions:(UIViewAnimationOptions)options completion:(void (^)(BOOL finished))completion { 125 | 126 | CGFloat damping = [self isSpringAnimationOn] ? 0.7f : 1.0f; 127 | 128 | if ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0) { 129 | [UIView animateWithDuration:0.5 delay:0.0 usingSpringWithDamping:damping initialSpringVelocity:velocity options:UIViewAnimationOptionAllowAnimatedContent animations:^{ 130 | [self.scrollView setContentOffset:CGPointMake(XHContentContainerViewOriginX, 0.0f) animated:NO]; 131 | } completion:^(BOOL finished) { 132 | self.openSide = XHDrawerSideNone; 133 | self.zoomDrawerView.contentContainerButton.userInteractionEnabled = NO; 134 | if (completion) { 135 | completion(finished); 136 | } 137 | }]; 138 | } else { 139 | [UIView animateWithDuration:0.3 delay:0 options:options animations:^{ 140 | [self.scrollView setContentOffset:CGPointMake(XHContentContainerViewOriginX, 0.0f) animated:NO]; 141 | } completion:^(BOOL finished) { 142 | self.openSide = XHDrawerSideNone; 143 | self.zoomDrawerView.contentContainerButton.userInteractionEnabled = NO; 144 | if (completion) { 145 | completion(finished); 146 | } 147 | }]; 148 | } 149 | } 150 | 151 | - (void)openDrawerSide:(XHDrawerSide)drawerSide animated:(BOOL)animated completion:(void (^)(BOOL finished))completion { 152 | NSParameterAssert(drawerSide != XHDrawerSideNone); 153 | 154 | [self openDrawerSide:drawerSide animated:animated velocity:self.animationVelocity animationOptions:UIViewAnimationOptionCurveEaseInOut completion:completion]; 155 | } 156 | 157 | - (void)openDrawerSide:(XHDrawerSide)drawerSide animated:(BOOL)animated velocity:(CGFloat)velocity animationOptions:(UIViewAnimationOptions)options completion:(void (^)(BOOL finished))completion { 158 | NSParameterAssert(drawerSide != XHDrawerSideNone); 159 | self.openSide = drawerSide; 160 | 161 | CGFloat damping = [self isSpringAnimationOn] ? 0.7f : 1.0f; 162 | 163 | if ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0) { 164 | [UIView animateWithDuration:0.5 delay:0.0 usingSpringWithDamping:damping initialSpringVelocity:velocity options:UIViewAnimationOptionAllowAnimatedContent animations:^{ 165 | if (drawerSide == XHDrawerSideLeft) { 166 | [self.scrollView setContentOffset:CGPointMake(0.0f, 0.0f) animated:NO]; 167 | } else if (drawerSide == XHDrawerSideRight) { 168 | [self.scrollView setContentOffset:CGPointMake(2 * XHContentContainerViewOriginX, 0.0f) animated:NO]; 169 | } 170 | } completion:^(BOOL finished) { 171 | self.openSide = drawerSide; 172 | self.zoomDrawerView.contentContainerButton.userInteractionEnabled = YES; 173 | if (completion) { 174 | completion(finished); 175 | } 176 | }]; 177 | } else { 178 | [UIView animateWithDuration:0.3 delay:0 options:options animations:^{ 179 | if (drawerSide == XHDrawerSideLeft) { 180 | [self.scrollView setContentOffset:CGPointMake(0.0f, 0.0f) animated:NO]; 181 | } else if (drawerSide == XHDrawerSideRight) { 182 | [self.scrollView setContentOffset:CGPointMake(2 * XHContentContainerViewOriginX, 0.0f) animated:NO]; 183 | } 184 | 185 | } completion:^(BOOL finished) { 186 | self.openSide = drawerSide; 187 | self.zoomDrawerView.contentContainerButton.userInteractionEnabled = YES; 188 | if (completion) { 189 | completion(finished); 190 | } 191 | }]; 192 | } 193 | } 194 | 195 | #pragma mark - Accessors 196 | 197 | - (void)setBackgroundView:(UIView *)backgroundView { 198 | self.zoomDrawerView.backgroundView = backgroundView; 199 | } 200 | 201 | - (UIView *)backgroundView { 202 | return self.zoomDrawerView.backgroundView; 203 | } 204 | 205 | - (UIScrollView *)scrollView { 206 | return self.zoomDrawerView.scrollView; 207 | } 208 | 209 | - (void)setCenterViewController:(UIViewController *)centerViewController { 210 | if (![self isViewLoaded]) { 211 | [self view]; 212 | } 213 | UIViewController *currentContentViewController =self.centerViewController; 214 | _centerViewController = centerViewController; 215 | 216 | UIView *contentContainerView = self.zoomDrawerView.contentContainerView; 217 | CGAffineTransform currentTransform = [contentContainerView transform]; 218 | [contentContainerView setTransform:CGAffineTransformIdentity]; 219 | 220 | [self replaceController:currentContentViewController 221 | newController:self.centerViewController 222 | container:self.zoomDrawerView.contentContainerView]; 223 | 224 | [contentContainerView setTransform:currentTransform]; 225 | [self.zoomDrawerView setNeedsLayout]; 226 | } 227 | 228 | - (void)setLeftViewController:(UIViewController *)leftViewController { 229 | if (![self isViewLoaded]) { 230 | [self view]; 231 | } 232 | UIViewController *currentLeftViewController = self.leftViewController; 233 | _leftViewController = leftViewController; 234 | [self replaceController:currentLeftViewController 235 | newController:self.leftViewController 236 | container:self.zoomDrawerView.leftContainerView]; 237 | } 238 | 239 | - (void)setRightViewController:(UIViewController *)rightViewController { 240 | if (![self isViewLoaded]) { 241 | [self view]; 242 | } 243 | UIViewController *currentLeftViewController = self.rightViewController; 244 | _rightViewController = rightViewController; 245 | [self replaceController:currentLeftViewController 246 | newController:self.rightViewController 247 | container:self.zoomDrawerView.rightContainerView]; 248 | } 249 | 250 | 251 | #pragma mark - Instance Methods 252 | 253 | - (void)contentContainerButtonPressed:(id)sender { 254 | [self closeDrawerAnimated:YES completion:NULL]; 255 | } 256 | 257 | - (void)replaceController:(UIViewController *)oldController newController:(UIViewController *)newController container:(UIView *)container 258 | { 259 | if (newController) { 260 | [self addChildViewController:newController]; 261 | [[newController view] setFrame:[container bounds]]; 262 | [newController setDrawerController:self]; 263 | 264 | if (oldController) { 265 | [self transitionFromViewController:oldController toViewController:newController duration:0.0 options:0 animations:nil completion:^(BOOL finished) { 266 | 267 | [newController didMoveToParentViewController:self]; 268 | 269 | [oldController willMoveToParentViewController:nil]; 270 | [oldController removeFromParentViewController]; 271 | [oldController setDrawerController:nil]; 272 | 273 | }]; 274 | } else { 275 | [container addSubview:[newController view]]; 276 | [newController didMoveToParentViewController:self]; 277 | } 278 | } else { 279 | [[oldController view] removeFromSuperview]; 280 | [oldController willMoveToParentViewController:nil]; 281 | [oldController removeFromParentViewController]; 282 | [oldController setDrawerController:nil]; 283 | } 284 | } 285 | 286 | - (void)updateContentContainerButton { 287 | CGPoint contentOffset = self.scrollView.contentOffset; 288 | CGFloat contentOffsetX = contentOffset.x; 289 | if (contentOffsetX < XHContentContainerViewOriginX) { 290 | self.zoomDrawerView.contentContainerButton.userInteractionEnabled = YES; 291 | } else if (contentOffsetX > XHContentContainerViewOriginX) { 292 | self.zoomDrawerView.contentContainerButton.userInteractionEnabled = YES; 293 | } else { 294 | self.zoomDrawerView.contentContainerButton.userInteractionEnabled = NO; 295 | } 296 | } 297 | 298 | #pragma mark - UIScrollViewDelegate Methods 299 | 300 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { 301 | self.cuurrentContentOffsetX = scrollView.contentOffset.x; 302 | } 303 | 304 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 305 | CGPoint contentOffset = [scrollView contentOffset]; 306 | 307 | CGFloat currentContentOffsetX = contentOffset.x; 308 | if (currentContentOffsetX > 0 && currentContentOffsetX < XHContentContainerViewOriginX && self.cuurrentContentOffsetX > currentContentOffsetX) { 309 | self.openSide = XHDrawerSideLeft; 310 | } else if (currentContentOffsetX > XHContentContainerViewOriginX && currentContentOffsetX < (XHContentContainerViewOriginX * 2) && self.cuurrentContentOffsetX < currentContentOffsetX) { 311 | self.openSide = XHDrawerSideRight; 312 | } 313 | 314 | CGFloat contentOffsetX = 0.0; 315 | if (self.openSide == XHDrawerSideRight) { 316 | contentOffsetX = XHContentContainerViewOriginX * 2 - contentOffset.x; 317 | } else if (self.openSide == XHDrawerSideLeft) { 318 | contentOffsetX = contentOffset.x; 319 | } 320 | 321 | 322 | CGFloat contentContainerScale = powf((contentOffsetX + XHContentContainerViewOriginX) / (XHContentContainerViewOriginX * 2.0f), .5f); 323 | if (isnan(contentContainerScale)) { 324 | contentContainerScale = 0.0f; 325 | } 326 | 327 | CGAffineTransform contentContainerViewTransform = CGAffineTransformMakeScale(contentContainerScale, contentContainerScale); 328 | CGAffineTransform leftContainerViewTransform = CGAffineTransformMakeTranslation(contentOffsetX / 1.5f, 0.0f); 329 | CGAffineTransform rightContainerViewTransform = CGAffineTransformMakeTranslation(contentOffsetX / -1.5f, 0.0f); 330 | 331 | self.zoomDrawerView.contentContainerView.transform = contentContainerViewTransform; 332 | 333 | self.zoomDrawerView.leftContainerView.transform = leftContainerViewTransform; 334 | self.zoomDrawerView.leftContainerView.alpha = 1 - contentOffsetX / XHContentContainerViewOriginX; 335 | 336 | self.zoomDrawerView.rightContainerView.transform = rightContainerViewTransform; 337 | self.zoomDrawerView.rightContainerView.alpha = 1 - contentOffsetX / XHContentContainerViewOriginX; 338 | 339 | if (self.openSide == XHDrawerSideLeft) { 340 | static BOOL leftContentViewControllerVisible = NO; 341 | if (contentOffsetX >= XHContentContainerViewOriginX) { 342 | if (leftContentViewControllerVisible) { 343 | [self.leftViewController beginAppearanceTransition:NO animated:YES]; 344 | [self.leftViewController endAppearanceTransition]; 345 | leftContentViewControllerVisible = NO; 346 | if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) 347 | [self setNeedsStatusBarAppearanceUpdate]; 348 | } 349 | } else if (contentOffsetX < XHContentContainerViewOriginX && !leftContentViewControllerVisible) { 350 | [self.leftViewController beginAppearanceTransition:YES animated:YES]; 351 | leftContentViewControllerVisible = YES; 352 | [self.leftViewController endAppearanceTransition]; 353 | if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) 354 | [self setNeedsStatusBarAppearanceUpdate]; 355 | } 356 | } else if (self.openSide == XHDrawerSideRight) { 357 | static BOOL rightContentViewControllerVisible = NO; 358 | if (contentOffsetX >= XHContentContainerViewOriginX) { 359 | if (rightContentViewControllerVisible) { 360 | [self.rightViewController beginAppearanceTransition:NO animated:YES]; 361 | [self.rightViewController endAppearanceTransition]; 362 | rightContentViewControllerVisible = NO; 363 | if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) 364 | [self setNeedsStatusBarAppearanceUpdate]; 365 | } 366 | } else if (contentOffsetX < XHContentContainerViewOriginX && !rightContentViewControllerVisible) { 367 | [self.rightViewController beginAppearanceTransition:YES animated:YES]; 368 | rightContentViewControllerVisible = YES; 369 | [self.rightViewController endAppearanceTransition]; 370 | if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) 371 | [self setNeedsStatusBarAppearanceUpdate]; 372 | } 373 | } 374 | } 375 | 376 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { 377 | [self updateContentContainerButton]; 378 | } 379 | 380 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { 381 | if (!decelerate) { 382 | [self updateContentContainerButton]; 383 | } 384 | } 385 | 386 | - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset { 387 | 388 | CGFloat targetContentOffsetX = targetContentOffset->x; 389 | CGFloat drawerPadding = XHContentContainerViewOriginX * 2 / 3.; 390 | if ((targetContentOffsetX >= drawerPadding && targetContentOffsetX < XHContentContainerViewOriginX && self.openSide == XHDrawerSideLeft) || (targetContentOffsetX > XHContentContainerViewOriginX && targetContentOffsetX <= (XHContentContainerViewOriginX * 2 - drawerPadding) && self.openSide == XHDrawerSideRight)) { 391 | targetContentOffset->x = XHContentContainerViewOriginX; 392 | } else if ((targetContentOffsetX >= 0 && targetContentOffsetX <= drawerPadding && self.openSide == XHDrawerSideLeft)) { 393 | targetContentOffset->x = 0.0f; 394 | self.openSide = XHDrawerSideLeft; 395 | } else if ((targetContentOffsetX > (XHContentContainerViewOriginX * 2 - drawerPadding) && targetContentOffsetX <= (XHContentContainerViewOriginX * 2) && self.openSide == XHDrawerSideRight)) { 396 | targetContentOffset->x = XHContentContainerViewOriginX * 2; 397 | self.openSide = XHDrawerSideRight; 398 | } 399 | } 400 | 401 | - (UIViewController *)childViewControllerForStatusBarStyle { 402 | UIViewController *viewController; 403 | if (self.scrollView.contentOffset.x < XHContentContainerViewOriginX) { 404 | viewController = self.leftViewController; 405 | } else if (self.scrollView.contentOffset.x > XHContentContainerViewOriginX) { 406 | viewController = self.rightViewController; 407 | } else { 408 | viewController = self.centerViewController; 409 | } 410 | return viewController; 411 | } 412 | 413 | - (UIViewController *)childViewControllerForStatusBarHidden { 414 | UIViewController *viewController; 415 | if (self.scrollView.contentOffset.x < XHContentContainerViewOriginX) { 416 | viewController = self.leftViewController; 417 | } else if (self.scrollView.contentOffset.x > XHContentContainerViewOriginX) { 418 | viewController = self.rightViewController; 419 | } else { 420 | viewController = self.centerViewController; 421 | } 422 | return viewController; 423 | } 424 | 425 | @end 426 | -------------------------------------------------------------------------------- /Source/XHDrawerControllerHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHDrawerControllerHeader.h 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #ifndef XHDrawerController_XHDrawerControllerHeader_h 10 | #define XHDrawerController_XHDrawerControllerHeader_h 11 | static const CGFloat XHContentContainerViewOriginX = 180.0f; 12 | 13 | static inline void xh_UIViewSetFrameOriginX(UIView *view, CGFloat originX) { 14 | [view setFrame:CGRectMake(originX, CGRectGetMinY([view frame]), CGRectGetWidth([view frame]), CGRectGetHeight([view frame]))]; 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /Source/XHZoomDrawerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHZoomDrawerView.h 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface XHZoomDrawerView : UIView 13 | 14 | @property (nonatomic, strong) UIScrollView *scrollView; 15 | @property (nonatomic, strong) UIView *backgroundView; 16 | @property (nonatomic, strong) UIView *contentContainerView; 17 | @property (nonatomic, strong) UIView *leftContainerView; 18 | @property (nonatomic, strong) UIView *rightContainerView; 19 | @property (nonatomic, strong) UIButton *contentContainerButton; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Source/XHZoomDrawerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHZoomDrawerView.m 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHZoomDrawerView.h" 10 | #import "XHDrawerControllerHeader.h" 11 | 12 | @implementation XHZoomDrawerView 13 | 14 | #pragma mark - UIView Overrides 15 | 16 | - (id)initWithFrame:(CGRect)frame { 17 | self = [super initWithFrame:frame]; 18 | if (self) { 19 | _scrollView = [[UIScrollView alloc] initWithFrame:self.bounds]; 20 | self.scrollView.scrollsToTop = NO; 21 | self.scrollView.scrollEnabled = NO; 22 | self.scrollView.showsHorizontalScrollIndicator = NO; 23 | self.scrollView.showsVerticalScrollIndicator = NO; 24 | self.scrollView.backgroundColor = [UIColor clearColor]; 25 | self.scrollView.contentSize = CGSizeMake((CGRectGetWidth(frame) + XHContentContainerViewOriginX * 2), CGRectGetHeight(frame)); 26 | 27 | // 左边 28 | _leftContainerView = [[UIView alloc] initWithFrame:self.bounds]; 29 | 30 | // 中间内容 31 | _contentContainerView = [[UIView alloc] initWithFrame:self.bounds]; 32 | xh_UIViewSetFrameOriginX(self.contentContainerView, XHContentContainerViewOriginX); 33 | 34 | // 中间内容按钮 35 | _contentContainerButton = [UIButton buttonWithType:UIButtonTypeCustom]; 36 | self.contentContainerButton.frame = self.contentContainerView.bounds; 37 | [self.contentContainerView addSubview:self.contentContainerButton]; 38 | 39 | // 右边 40 | _rightContainerView = [[UIView alloc] initWithFrame:self.bounds]; 41 | xh_UIViewSetFrameOriginX(self.rightContainerView, CGRectGetWidth(self.contentContainerView.frame) + XHContentContainerViewOriginX); 42 | 43 | 44 | [self.scrollView setContentOffset:CGPointMake(XHContentContainerViewOriginX, 0.0f) animated:NO]; 45 | 46 | [self.scrollView addSubview:self.leftContainerView]; 47 | [self.scrollView addSubview:self.rightContainerView]; 48 | [self.scrollView addSubview:self.contentContainerView]; 49 | [self addSubview:self.scrollView]; 50 | } 51 | return self; 52 | } 53 | 54 | - (void)layoutSubviews { 55 | [super layoutSubviews]; 56 | 57 | self.backgroundView.frame = self.bounds; 58 | [self.contentContainerView bringSubviewToFront:self.contentContainerButton]; 59 | } 60 | 61 | #pragma mark - Accessors 62 | 63 | - (void)setBackgroundView:(UIView *)backgroundView { 64 | [self.backgroundView removeFromSuperview]; 65 | _backgroundView = backgroundView; 66 | [self insertSubview:self.backgroundView atIndex:0]; 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /XHDrawerController.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "XHDrawerController" 3 | s.version = "0.1.0" 4 | s.summary = "Integrate easily a sliding panel controller mechanism in your project!" 5 | s.homepage = "https://github.com/JackTeam/XHDrawerController" 6 | s.license = "MIT" 7 | s.authors = { "xhzengAIB" => "xhzengAIB@gmail.com" } 8 | s.source = { :git => "https://github.com/JackTeam/XHDrawerController.git", :tag => "v0.1.0" } 9 | s.frameworks = 'Foundation', 'CoreGraphics', 'UIKit' 10 | s.platform = :ios, '5.0' 11 | s.source_files = 'Source' 12 | s.requires_arc = true 13 | end 14 | --------------------------------------------------------------------------------