├── README.md ├── SlideViewForFilter.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── Wings.xcuserdatad │ └── xcschemes │ ├── SlideViewForFilter.xcscheme │ └── xcschememanagement.plist ├── SlideViewForFilter ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── icon_Back Chevron.imageset │ │ ├── Contents.json │ │ └── icon_Back Chevron.pdf │ ├── icon_Check.imageset │ │ ├── Contents.json │ │ └── icon_Check.pdf │ └── icon_Disclosure Indicator.imageset │ │ ├── Contents.json │ │ └── icon_Disclosure Indicator.pdf ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CustomSlideBar.h ├── CustomSlideBar.m ├── DetailInfoTableViewCell.h ├── DetailInfoTableViewCell.m ├── DetailInfoTableViewCell.xib ├── FilterSlideDataViewController.h ├── FilterSlideDataViewController.m ├── Info.plist ├── InfoTableViewCell.h ├── InfoTableViewCell.m ├── InfoTableViewCell.xib ├── ViewController.h ├── ViewController.m └── main.m └── SlideViewForFilterTests ├── Info.plist └── SlideViewForFilterTests.m /README.md: -------------------------------------------------------------------------------- 1 | # SlideViewForFilter 2 | 二级侧滑菜单,用于复杂条件筛选 3 | 4 | 这只是一个Demo. 5 | -------------------------------------------------------------------------------- /SlideViewForFilter.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 012FECA11CF7DD7000459FF5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 012FECA01CF7DD7000459FF5 /* main.m */; }; 11 | 012FECA41CF7DD7000459FF5 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 012FECA31CF7DD7000459FF5 /* AppDelegate.m */; }; 12 | 012FECA71CF7DD7000459FF5 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 012FECA61CF7DD7000459FF5 /* ViewController.m */; }; 13 | 012FECAA1CF7DD7000459FF5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 012FECA81CF7DD7000459FF5 /* Main.storyboard */; }; 14 | 012FECAC1CF7DD7000459FF5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 012FECAB1CF7DD7000459FF5 /* Assets.xcassets */; }; 15 | 012FECAF1CF7DD7000459FF5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 012FECAD1CF7DD7000459FF5 /* LaunchScreen.storyboard */; }; 16 | 012FECBA1CF7DD7000459FF5 /* SlideViewForFilterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 012FECB91CF7DD7000459FF5 /* SlideViewForFilterTests.m */; }; 17 | 012FECCC1CF7DDE100459FF5 /* CustomSlideBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 012FECC61CF7DDE100459FF5 /* CustomSlideBar.m */; }; 18 | 012FECCD1CF7DDE100459FF5 /* FilterSlideDataViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 012FECC81CF7DDE100459FF5 /* FilterSlideDataViewController.m */; }; 19 | 01FE6DA81CFAEB9300511878 /* InfoTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 01FE6DA61CFAEB9300511878 /* InfoTableViewCell.m */; }; 20 | 01FE6DA91CFAEB9300511878 /* InfoTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 01FE6DA71CFAEB9300511878 /* InfoTableViewCell.xib */; }; 21 | 01FE6DAD1CFAEBAF00511878 /* DetailInfoTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 01FE6DAB1CFAEBAF00511878 /* DetailInfoTableViewCell.m */; }; 22 | 01FE6DAE1CFAEBAF00511878 /* DetailInfoTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 01FE6DAC1CFAEBAF00511878 /* DetailInfoTableViewCell.xib */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXContainerItemProxy section */ 26 | 012FECB61CF7DD7000459FF5 /* PBXContainerItemProxy */ = { 27 | isa = PBXContainerItemProxy; 28 | containerPortal = 012FEC941CF7DD7000459FF5 /* Project object */; 29 | proxyType = 1; 30 | remoteGlobalIDString = 012FEC9B1CF7DD7000459FF5; 31 | remoteInfo = SlideViewForFilter; 32 | }; 33 | /* End PBXContainerItemProxy section */ 34 | 35 | /* Begin PBXFileReference section */ 36 | 012FEC9C1CF7DD7000459FF5 /* SlideViewForFilter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SlideViewForFilter.app; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 012FECA01CF7DD7000459FF5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 38 | 012FECA21CF7DD7000459FF5 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 39 | 012FECA31CF7DD7000459FF5 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 40 | 012FECA51CF7DD7000459FF5 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 41 | 012FECA61CF7DD7000459FF5 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 42 | 012FECA91CF7DD7000459FF5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 43 | 012FECAB1CF7DD7000459FF5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 44 | 012FECAE1CF7DD7000459FF5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 45 | 012FECB01CF7DD7000459FF5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | 012FECB51CF7DD7000459FF5 /* SlideViewForFilterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SlideViewForFilterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 012FECB91CF7DD7000459FF5 /* SlideViewForFilterTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SlideViewForFilterTests.m; sourceTree = ""; }; 48 | 012FECBB1CF7DD7000459FF5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 012FECC51CF7DDE100459FF5 /* CustomSlideBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomSlideBar.h; sourceTree = ""; }; 50 | 012FECC61CF7DDE100459FF5 /* CustomSlideBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomSlideBar.m; sourceTree = ""; }; 51 | 012FECC71CF7DDE100459FF5 /* FilterSlideDataViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FilterSlideDataViewController.h; sourceTree = ""; }; 52 | 012FECC81CF7DDE100459FF5 /* FilterSlideDataViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FilterSlideDataViewController.m; sourceTree = ""; }; 53 | 01FE6DA51CFAEB9300511878 /* InfoTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfoTableViewCell.h; sourceTree = ""; }; 54 | 01FE6DA61CFAEB9300511878 /* InfoTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InfoTableViewCell.m; sourceTree = ""; }; 55 | 01FE6DA71CFAEB9300511878 /* InfoTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InfoTableViewCell.xib; sourceTree = ""; }; 56 | 01FE6DAA1CFAEBAF00511878 /* DetailInfoTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailInfoTableViewCell.h; sourceTree = ""; }; 57 | 01FE6DAB1CFAEBAF00511878 /* DetailInfoTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailInfoTableViewCell.m; sourceTree = ""; }; 58 | 01FE6DAC1CFAEBAF00511878 /* DetailInfoTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DetailInfoTableViewCell.xib; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | 012FEC991CF7DD7000459FF5 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | 012FECB21CF7DD7000459FF5 /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | /* End PBXFrameworksBuildPhase section */ 77 | 78 | /* Begin PBXGroup section */ 79 | 012FEC931CF7DD7000459FF5 = { 80 | isa = PBXGroup; 81 | children = ( 82 | 012FEC9E1CF7DD7000459FF5 /* SlideViewForFilter */, 83 | 012FECB81CF7DD7000459FF5 /* SlideViewForFilterTests */, 84 | 012FEC9D1CF7DD7000459FF5 /* Products */, 85 | ); 86 | sourceTree = ""; 87 | }; 88 | 012FEC9D1CF7DD7000459FF5 /* Products */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 012FEC9C1CF7DD7000459FF5 /* SlideViewForFilter.app */, 92 | 012FECB51CF7DD7000459FF5 /* SlideViewForFilterTests.xctest */, 93 | ); 94 | name = Products; 95 | sourceTree = ""; 96 | }; 97 | 012FEC9E1CF7DD7000459FF5 /* SlideViewForFilter */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 012FECC41CF7DD8F00459FF5 /* view */, 101 | 012FECA21CF7DD7000459FF5 /* AppDelegate.h */, 102 | 012FECA31CF7DD7000459FF5 /* AppDelegate.m */, 103 | 012FECA51CF7DD7000459FF5 /* ViewController.h */, 104 | 012FECA61CF7DD7000459FF5 /* ViewController.m */, 105 | 012FECA81CF7DD7000459FF5 /* Main.storyboard */, 106 | 012FECAB1CF7DD7000459FF5 /* Assets.xcassets */, 107 | 012FECAD1CF7DD7000459FF5 /* LaunchScreen.storyboard */, 108 | 012FECB01CF7DD7000459FF5 /* Info.plist */, 109 | 012FEC9F1CF7DD7000459FF5 /* Supporting Files */, 110 | ); 111 | path = SlideViewForFilter; 112 | sourceTree = ""; 113 | }; 114 | 012FEC9F1CF7DD7000459FF5 /* Supporting Files */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 012FECA01CF7DD7000459FF5 /* main.m */, 118 | ); 119 | name = "Supporting Files"; 120 | sourceTree = ""; 121 | }; 122 | 012FECB81CF7DD7000459FF5 /* SlideViewForFilterTests */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 012FECB91CF7DD7000459FF5 /* SlideViewForFilterTests.m */, 126 | 012FECBB1CF7DD7000459FF5 /* Info.plist */, 127 | ); 128 | path = SlideViewForFilterTests; 129 | sourceTree = ""; 130 | }; 131 | 012FECC41CF7DD8F00459FF5 /* view */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 012FECC51CF7DDE100459FF5 /* CustomSlideBar.h */, 135 | 012FECC61CF7DDE100459FF5 /* CustomSlideBar.m */, 136 | 01FE6DA51CFAEB9300511878 /* InfoTableViewCell.h */, 137 | 01FE6DA61CFAEB9300511878 /* InfoTableViewCell.m */, 138 | 01FE6DA71CFAEB9300511878 /* InfoTableViewCell.xib */, 139 | 01FE6DAA1CFAEBAF00511878 /* DetailInfoTableViewCell.h */, 140 | 01FE6DAB1CFAEBAF00511878 /* DetailInfoTableViewCell.m */, 141 | 01FE6DAC1CFAEBAF00511878 /* DetailInfoTableViewCell.xib */, 142 | 012FECC71CF7DDE100459FF5 /* FilterSlideDataViewController.h */, 143 | 012FECC81CF7DDE100459FF5 /* FilterSlideDataViewController.m */, 144 | ); 145 | name = view; 146 | sourceTree = ""; 147 | }; 148 | /* End PBXGroup section */ 149 | 150 | /* Begin PBXNativeTarget section */ 151 | 012FEC9B1CF7DD7000459FF5 /* SlideViewForFilter */ = { 152 | isa = PBXNativeTarget; 153 | buildConfigurationList = 012FECBE1CF7DD7000459FF5 /* Build configuration list for PBXNativeTarget "SlideViewForFilter" */; 154 | buildPhases = ( 155 | 012FEC981CF7DD7000459FF5 /* Sources */, 156 | 012FEC991CF7DD7000459FF5 /* Frameworks */, 157 | 012FEC9A1CF7DD7000459FF5 /* Resources */, 158 | ); 159 | buildRules = ( 160 | ); 161 | dependencies = ( 162 | ); 163 | name = SlideViewForFilter; 164 | productName = SlideViewForFilter; 165 | productReference = 012FEC9C1CF7DD7000459FF5 /* SlideViewForFilter.app */; 166 | productType = "com.apple.product-type.application"; 167 | }; 168 | 012FECB41CF7DD7000459FF5 /* SlideViewForFilterTests */ = { 169 | isa = PBXNativeTarget; 170 | buildConfigurationList = 012FECC11CF7DD7000459FF5 /* Build configuration list for PBXNativeTarget "SlideViewForFilterTests" */; 171 | buildPhases = ( 172 | 012FECB11CF7DD7000459FF5 /* Sources */, 173 | 012FECB21CF7DD7000459FF5 /* Frameworks */, 174 | 012FECB31CF7DD7000459FF5 /* Resources */, 175 | ); 176 | buildRules = ( 177 | ); 178 | dependencies = ( 179 | 012FECB71CF7DD7000459FF5 /* PBXTargetDependency */, 180 | ); 181 | name = SlideViewForFilterTests; 182 | productName = SlideViewForFilterTests; 183 | productReference = 012FECB51CF7DD7000459FF5 /* SlideViewForFilterTests.xctest */; 184 | productType = "com.apple.product-type.bundle.unit-test"; 185 | }; 186 | /* End PBXNativeTarget section */ 187 | 188 | /* Begin PBXProject section */ 189 | 012FEC941CF7DD7000459FF5 /* Project object */ = { 190 | isa = PBXProject; 191 | attributes = { 192 | LastUpgradeCheck = 0730; 193 | ORGANIZATIONNAME = wings; 194 | TargetAttributes = { 195 | 012FEC9B1CF7DD7000459FF5 = { 196 | CreatedOnToolsVersion = 7.3.1; 197 | }; 198 | 012FECB41CF7DD7000459FF5 = { 199 | CreatedOnToolsVersion = 7.3.1; 200 | TestTargetID = 012FEC9B1CF7DD7000459FF5; 201 | }; 202 | }; 203 | }; 204 | buildConfigurationList = 012FEC971CF7DD7000459FF5 /* Build configuration list for PBXProject "SlideViewForFilter" */; 205 | compatibilityVersion = "Xcode 3.2"; 206 | developmentRegion = English; 207 | hasScannedForEncodings = 0; 208 | knownRegions = ( 209 | en, 210 | Base, 211 | ); 212 | mainGroup = 012FEC931CF7DD7000459FF5; 213 | productRefGroup = 012FEC9D1CF7DD7000459FF5 /* Products */; 214 | projectDirPath = ""; 215 | projectRoot = ""; 216 | targets = ( 217 | 012FEC9B1CF7DD7000459FF5 /* SlideViewForFilter */, 218 | 012FECB41CF7DD7000459FF5 /* SlideViewForFilterTests */, 219 | ); 220 | }; 221 | /* End PBXProject section */ 222 | 223 | /* Begin PBXResourcesBuildPhase section */ 224 | 012FEC9A1CF7DD7000459FF5 /* Resources */ = { 225 | isa = PBXResourcesBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | 01FE6DA91CFAEB9300511878 /* InfoTableViewCell.xib in Resources */, 229 | 01FE6DAE1CFAEBAF00511878 /* DetailInfoTableViewCell.xib in Resources */, 230 | 012FECAF1CF7DD7000459FF5 /* LaunchScreen.storyboard in Resources */, 231 | 012FECAC1CF7DD7000459FF5 /* Assets.xcassets in Resources */, 232 | 012FECAA1CF7DD7000459FF5 /* Main.storyboard in Resources */, 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | }; 236 | 012FECB31CF7DD7000459FF5 /* Resources */ = { 237 | isa = PBXResourcesBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | }; 243 | /* End PBXResourcesBuildPhase section */ 244 | 245 | /* Begin PBXSourcesBuildPhase section */ 246 | 012FEC981CF7DD7000459FF5 /* Sources */ = { 247 | isa = PBXSourcesBuildPhase; 248 | buildActionMask = 2147483647; 249 | files = ( 250 | 012FECCC1CF7DDE100459FF5 /* CustomSlideBar.m in Sources */, 251 | 012FECA71CF7DD7000459FF5 /* ViewController.m in Sources */, 252 | 012FECA41CF7DD7000459FF5 /* AppDelegate.m in Sources */, 253 | 012FECCD1CF7DDE100459FF5 /* FilterSlideDataViewController.m in Sources */, 254 | 012FECA11CF7DD7000459FF5 /* main.m in Sources */, 255 | 01FE6DAD1CFAEBAF00511878 /* DetailInfoTableViewCell.m in Sources */, 256 | 01FE6DA81CFAEB9300511878 /* InfoTableViewCell.m in Sources */, 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | 012FECB11CF7DD7000459FF5 /* Sources */ = { 261 | isa = PBXSourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | 012FECBA1CF7DD7000459FF5 /* SlideViewForFilterTests.m in Sources */, 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | /* End PBXSourcesBuildPhase section */ 269 | 270 | /* Begin PBXTargetDependency section */ 271 | 012FECB71CF7DD7000459FF5 /* PBXTargetDependency */ = { 272 | isa = PBXTargetDependency; 273 | target = 012FEC9B1CF7DD7000459FF5 /* SlideViewForFilter */; 274 | targetProxy = 012FECB61CF7DD7000459FF5 /* PBXContainerItemProxy */; 275 | }; 276 | /* End PBXTargetDependency section */ 277 | 278 | /* Begin PBXVariantGroup section */ 279 | 012FECA81CF7DD7000459FF5 /* Main.storyboard */ = { 280 | isa = PBXVariantGroup; 281 | children = ( 282 | 012FECA91CF7DD7000459FF5 /* Base */, 283 | ); 284 | name = Main.storyboard; 285 | sourceTree = ""; 286 | }; 287 | 012FECAD1CF7DD7000459FF5 /* LaunchScreen.storyboard */ = { 288 | isa = PBXVariantGroup; 289 | children = ( 290 | 012FECAE1CF7DD7000459FF5 /* Base */, 291 | ); 292 | name = LaunchScreen.storyboard; 293 | sourceTree = ""; 294 | }; 295 | /* End PBXVariantGroup section */ 296 | 297 | /* Begin XCBuildConfiguration section */ 298 | 012FECBC1CF7DD7000459FF5 /* Debug */ = { 299 | isa = XCBuildConfiguration; 300 | buildSettings = { 301 | ALWAYS_SEARCH_USER_PATHS = NO; 302 | CLANG_ANALYZER_NONNULL = YES; 303 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 304 | CLANG_CXX_LIBRARY = "libc++"; 305 | CLANG_ENABLE_MODULES = YES; 306 | CLANG_ENABLE_OBJC_ARC = YES; 307 | CLANG_WARN_BOOL_CONVERSION = YES; 308 | CLANG_WARN_CONSTANT_CONVERSION = YES; 309 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 310 | CLANG_WARN_EMPTY_BODY = YES; 311 | CLANG_WARN_ENUM_CONVERSION = YES; 312 | CLANG_WARN_INT_CONVERSION = YES; 313 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 314 | CLANG_WARN_UNREACHABLE_CODE = YES; 315 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 316 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 317 | COPY_PHASE_STRIP = NO; 318 | DEBUG_INFORMATION_FORMAT = dwarf; 319 | ENABLE_STRICT_OBJC_MSGSEND = YES; 320 | ENABLE_TESTABILITY = YES; 321 | GCC_C_LANGUAGE_STANDARD = gnu99; 322 | GCC_DYNAMIC_NO_PIC = NO; 323 | GCC_NO_COMMON_BLOCKS = YES; 324 | GCC_OPTIMIZATION_LEVEL = 0; 325 | GCC_PREPROCESSOR_DEFINITIONS = ( 326 | "DEBUG=1", 327 | "$(inherited)", 328 | ); 329 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 330 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 331 | GCC_WARN_UNDECLARED_SELECTOR = YES; 332 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 333 | GCC_WARN_UNUSED_FUNCTION = YES; 334 | GCC_WARN_UNUSED_VARIABLE = YES; 335 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 336 | MTL_ENABLE_DEBUG_INFO = YES; 337 | ONLY_ACTIVE_ARCH = YES; 338 | SDKROOT = iphoneos; 339 | }; 340 | name = Debug; 341 | }; 342 | 012FECBD1CF7DD7000459FF5 /* Release */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ALWAYS_SEARCH_USER_PATHS = NO; 346 | CLANG_ANALYZER_NONNULL = YES; 347 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 348 | CLANG_CXX_LIBRARY = "libc++"; 349 | CLANG_ENABLE_MODULES = YES; 350 | CLANG_ENABLE_OBJC_ARC = YES; 351 | CLANG_WARN_BOOL_CONVERSION = YES; 352 | CLANG_WARN_CONSTANT_CONVERSION = YES; 353 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 354 | CLANG_WARN_EMPTY_BODY = YES; 355 | CLANG_WARN_ENUM_CONVERSION = YES; 356 | CLANG_WARN_INT_CONVERSION = YES; 357 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 358 | CLANG_WARN_UNREACHABLE_CODE = YES; 359 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 360 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 361 | COPY_PHASE_STRIP = NO; 362 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 363 | ENABLE_NS_ASSERTIONS = NO; 364 | ENABLE_STRICT_OBJC_MSGSEND = YES; 365 | GCC_C_LANGUAGE_STANDARD = gnu99; 366 | GCC_NO_COMMON_BLOCKS = YES; 367 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 368 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 369 | GCC_WARN_UNDECLARED_SELECTOR = YES; 370 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 371 | GCC_WARN_UNUSED_FUNCTION = YES; 372 | GCC_WARN_UNUSED_VARIABLE = YES; 373 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 374 | MTL_ENABLE_DEBUG_INFO = NO; 375 | SDKROOT = iphoneos; 376 | VALIDATE_PRODUCT = YES; 377 | }; 378 | name = Release; 379 | }; 380 | 012FECBF1CF7DD7000459FF5 /* Debug */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 384 | INFOPLIST_FILE = SlideViewForFilter/Info.plist; 385 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 386 | PRODUCT_BUNDLE_IDENTIFIER = com.vince.SlideViewForFilter; 387 | PRODUCT_NAME = "$(TARGET_NAME)"; 388 | }; 389 | name = Debug; 390 | }; 391 | 012FECC01CF7DD7000459FF5 /* Release */ = { 392 | isa = XCBuildConfiguration; 393 | buildSettings = { 394 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 395 | INFOPLIST_FILE = SlideViewForFilter/Info.plist; 396 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 397 | PRODUCT_BUNDLE_IDENTIFIER = com.vince.SlideViewForFilter; 398 | PRODUCT_NAME = "$(TARGET_NAME)"; 399 | }; 400 | name = Release; 401 | }; 402 | 012FECC21CF7DD7000459FF5 /* Debug */ = { 403 | isa = XCBuildConfiguration; 404 | buildSettings = { 405 | BUNDLE_LOADER = "$(TEST_HOST)"; 406 | INFOPLIST_FILE = SlideViewForFilterTests/Info.plist; 407 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 408 | PRODUCT_BUNDLE_IDENTIFIER = com.vince.SlideViewForFilterTests; 409 | PRODUCT_NAME = "$(TARGET_NAME)"; 410 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SlideViewForFilter.app/SlideViewForFilter"; 411 | }; 412 | name = Debug; 413 | }; 414 | 012FECC31CF7DD7000459FF5 /* Release */ = { 415 | isa = XCBuildConfiguration; 416 | buildSettings = { 417 | BUNDLE_LOADER = "$(TEST_HOST)"; 418 | INFOPLIST_FILE = SlideViewForFilterTests/Info.plist; 419 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 420 | PRODUCT_BUNDLE_IDENTIFIER = com.vince.SlideViewForFilterTests; 421 | PRODUCT_NAME = "$(TARGET_NAME)"; 422 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SlideViewForFilter.app/SlideViewForFilter"; 423 | }; 424 | name = Release; 425 | }; 426 | /* End XCBuildConfiguration section */ 427 | 428 | /* Begin XCConfigurationList section */ 429 | 012FEC971CF7DD7000459FF5 /* Build configuration list for PBXProject "SlideViewForFilter" */ = { 430 | isa = XCConfigurationList; 431 | buildConfigurations = ( 432 | 012FECBC1CF7DD7000459FF5 /* Debug */, 433 | 012FECBD1CF7DD7000459FF5 /* Release */, 434 | ); 435 | defaultConfigurationIsVisible = 0; 436 | defaultConfigurationName = Release; 437 | }; 438 | 012FECBE1CF7DD7000459FF5 /* Build configuration list for PBXNativeTarget "SlideViewForFilter" */ = { 439 | isa = XCConfigurationList; 440 | buildConfigurations = ( 441 | 012FECBF1CF7DD7000459FF5 /* Debug */, 442 | 012FECC01CF7DD7000459FF5 /* Release */, 443 | ); 444 | defaultConfigurationIsVisible = 0; 445 | defaultConfigurationName = Release; 446 | }; 447 | 012FECC11CF7DD7000459FF5 /* Build configuration list for PBXNativeTarget "SlideViewForFilterTests" */ = { 448 | isa = XCConfigurationList; 449 | buildConfigurations = ( 450 | 012FECC21CF7DD7000459FF5 /* Debug */, 451 | 012FECC31CF7DD7000459FF5 /* Release */, 452 | ); 453 | defaultConfigurationIsVisible = 0; 454 | defaultConfigurationName = Release; 455 | }; 456 | /* End XCConfigurationList section */ 457 | }; 458 | rootObject = 012FEC941CF7DD7000459FF5 /* Project object */; 459 | } 460 | -------------------------------------------------------------------------------- /SlideViewForFilter.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SlideViewForFilter.xcodeproj/xcuserdata/Wings.xcuserdatad/xcschemes/SlideViewForFilter.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /SlideViewForFilter.xcodeproj/xcuserdata/Wings.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SlideViewForFilter.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 012FEC9B1CF7DD7000459FF5 16 | 17 | primary 18 | 19 | 20 | 012FECB41CF7DD7000459FF5 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SlideViewForFilter/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SlideViewForFilter 4 | // 5 | // Created by 饶首建 on 16/5/27. 6 | // Copyright © 2016年 wings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /SlideViewForFilter/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SlideViewForFilter 4 | // 5 | // Created by 饶首建 on 16/5/27. 6 | // Copyright © 2016年 wings. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /SlideViewForFilter/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /SlideViewForFilter/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SlideViewForFilter/Assets.xcassets/icon_Back Chevron.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_Back Chevron.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SlideViewForFilter/Assets.xcassets/icon_Back Chevron.imageset/icon_Back Chevron.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wingsrao/SlideViewForFilter/581dc6c0b43141e6cd0cd67416011a3333f94dac/SlideViewForFilter/Assets.xcassets/icon_Back Chevron.imageset/icon_Back Chevron.pdf -------------------------------------------------------------------------------- /SlideViewForFilter/Assets.xcassets/icon_Check.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_Check.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SlideViewForFilter/Assets.xcassets/icon_Check.imageset/icon_Check.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wingsrao/SlideViewForFilter/581dc6c0b43141e6cd0cd67416011a3333f94dac/SlideViewForFilter/Assets.xcassets/icon_Check.imageset/icon_Check.pdf -------------------------------------------------------------------------------- /SlideViewForFilter/Assets.xcassets/icon_Disclosure Indicator.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_Disclosure Indicator.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /SlideViewForFilter/Assets.xcassets/icon_Disclosure Indicator.imageset/icon_Disclosure Indicator.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wingsrao/SlideViewForFilter/581dc6c0b43141e6cd0cd67416011a3333f94dac/SlideViewForFilter/Assets.xcassets/icon_Disclosure Indicator.imageset/icon_Disclosure Indicator.pdf -------------------------------------------------------------------------------- /SlideViewForFilter/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SlideViewForFilter/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 31 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /SlideViewForFilter/CustomSlideBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // CustomSlideBar.h 3 | // Vasse 4 | // 5 | // Created by 饶首建 on 16/5/18. 6 | // Copyright © 2016年 voossi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define kSidebarWidth [UIScreen mainScreen].bounds.size.width*0.8 12 | #define kSBWidth [UIScreen mainScreen].bounds.size.width 13 | #define kSBHeight [UIScreen mainScreen].bounds.size.height 14 | 15 | @interface CustomSlideBar : UIViewController 16 | 17 | @property (nonatomic, retain) UIView* contentView; //侧滑容器 18 | @property (nonatomic, assign) BOOL isSidebarShown; 19 | 20 | /** 21 | * 设置侧栏的背景色 22 | */ 23 | - (void)setBgColor:(UIColor*)color; 24 | 25 | /** 26 | * 当有pan事件时调用,传入UIPanGestureRecognizer 27 | */ 28 | - (void)panDetected:(UIPanGestureRecognizer *)recoginzer; 29 | 30 | /** 31 | * 显示/隐藏Sidebar 32 | */ 33 | - (void)showHideSidebar; 34 | 35 | /** 36 | * 已经完成显示,需要时可以在子类中用 37 | */ 38 | - (void)sidebarDidShown; 39 | 40 | /** 41 | * 触发了右滑事件,需要时可以在子类中用 42 | */ 43 | - (void)slideToRight; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /SlideViewForFilter/CustomSlideBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomSlideBar.m 3 | // Vasse 4 | // 5 | // Created by 饶首建 on 16/5/18. 6 | // Copyright © 2016年 voossi. All rights reserved. 7 | // 8 | 9 | #import "CustomSlideBar.h" 10 | #import 11 | 12 | #define duration 0.2 13 | 14 | @interface CustomSlideBar() 15 | { 16 | CGPoint startTouchPoint; // 手指按下时的坐标 17 | CGFloat startContentOriginX; // 移动前的窗口位置 18 | BOOL _isMoving; 19 | UIColor *_bgColor; 20 | } 21 | 22 | @property (nonatomic, retain) UIView* shadowView; 23 | 24 | @end 25 | 26 | 27 | @implementation CustomSlideBar 28 | 29 | - (void)viewDidLoad { 30 | [super viewDidLoad]; 31 | 32 | self.view.userInteractionEnabled = YES; 33 | self.view.backgroundColor = [UIColor clearColor]; 34 | 35 | self.shadowView = [[UIView alloc] initWithFrame:self.view.bounds]; 36 | self.shadowView.userInteractionEnabled = YES; 37 | [self.view addSubview:self.shadowView]; 38 | self.shadowView.backgroundColor = [UIColor blackColor]; 39 | self.shadowView.alpha = 0; 40 | 41 | UITapGestureRecognizer *tapShadow = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(hideSlideBar)]; 42 | [self.shadowView addGestureRecognizer:tapShadow]; 43 | 44 | _bgColor = [UIColor whiteColor]; 45 | 46 | UITapGestureRecognizer* recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapDetected:)]; 47 | recognizer.delegate = self; 48 | [recognizer delaysTouchesBegan]; 49 | [self.view addGestureRecognizer:recognizer]; 50 | 51 | //列表 52 | CGRect rect = CGRectMake(kSBWidth, 0, kSidebarWidth, self.view.bounds.size.height); 53 | self.contentView = [[UIView alloc] initWithFrame:rect]; 54 | [self.view addSubview:self.contentView]; 55 | 56 | self.view.hidden = YES; 57 | } 58 | 59 | - (void)hideSlideBar{ 60 | [self showHideSidebar]; 61 | } 62 | 63 | 64 | #pragma mark - 显示/隐藏 65 | 66 | - (BOOL)isSidebarShown{ 67 | return self.contentView.frame.origin.x < kSidebarWidth ? YES :NO; 68 | } 69 | 70 | - (void)showHideSidebar{ 71 | if (self.contentView.frame.origin.x == kSBWidth) { 72 | startContentOriginX = self.contentView.frame.origin.x; 73 | } 74 | [self autoShowHideSidebar]; 75 | } 76 | 77 | #pragma mark 子类中可用的 78 | - (void)slideToRight 79 | { 80 | // NSLog(@"触发了右滑事件,需要时可以在子类中用"); 81 | } 82 | 83 | - (void)sidebarDidShown 84 | { 85 | // NSLog(@"已经完成显示,需要时可以在子类中用"); 86 | } 87 | 88 | #pragma mark Private 89 | - (void)autoShowHideSidebar 90 | { 91 | if (!self.isSidebarShown){ 92 | // NSLog(@"自动弹出"); 93 | self.view.hidden = NO; 94 | [UIView animateWithDuration:duration animations:^{ 95 | [self setSidebarOriginX:kSBWidth - kSidebarWidth]; 96 | } completion:^(BOOL finished) { 97 | _isMoving = NO; 98 | [self sidebarDidShown]; 99 | }]; 100 | }else{ 101 | // NSLog(@"自动缩回"); 102 | [UIView animateWithDuration:duration animations:^{ 103 | [self setSidebarOriginX:kSBWidth]; 104 | } completion:^(BOOL finished) { 105 | _isMoving = NO; 106 | self.view.hidden = YES; 107 | [self slideToRight]; 108 | }]; 109 | } 110 | } 111 | 112 | #pragma mark - 手势响应 113 | - (void)tapDetected:(UITapGestureRecognizer*)recognizer 114 | { 115 | [self autoShowHideSidebar]; 116 | } 117 | 118 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch 119 | { 120 | CGPoint point = [touch locationInView:self.view]; 121 | if (point.x < kSBWidth) { 122 | return NO; 123 | } 124 | return YES; 125 | } 126 | 127 | - (void)panDetected:(UIPanGestureRecognizer *)recoginzer 128 | { 129 | CGPoint touchPoint = [recoginzer locationInView:self.view]; 130 | CGFloat offsetX = touchPoint.x - startTouchPoint.x; 131 | 132 | if (recoginzer.state == UIGestureRecognizerStateBegan) { 133 | _isMoving = YES; 134 | startTouchPoint = touchPoint; 135 | self.view.hidden = NO; 136 | // 记录按下时的x位置 137 | startContentOriginX = self.contentView.frame.origin.x; 138 | }else if (recoginzer.state == UIGestureRecognizerStateEnded){ 139 | if (offsetX > 40 || ((int)startContentOriginX==0 && offsetX<0 && offsetX>-20)){ 140 | // NSLog(@"隐藏"); 141 | [UIView animateWithDuration:duration animations:^{ 142 | [self setSidebarOriginX:kSBWidth]; 143 | } completion:^(BOOL finished) { 144 | _isMoving = NO; 145 | self.view.hidden = YES; 146 | [self slideToRight]; 147 | }]; 148 | }else{ 149 | // NSLog(@"显示"); 150 | self.view.hidden = NO; 151 | [UIView animateWithDuration:duration animations:^{ 152 | [self setSidebarOriginX:kSBWidth - kSidebarWidth]; 153 | } completion:^(BOOL finished) { 154 | _isMoving = NO; 155 | [self sidebarDidShown]; 156 | }]; 157 | } 158 | return; 159 | }else if (recoginzer.state == UIGestureRecognizerStateCancelled){ 160 | [UIView animateWithDuration:duration animations:^{ 161 | [self setSidebarOriginX:kSBWidth]; 162 | } completion:^(BOOL finished) { 163 | _isMoving = NO; 164 | self.view.hidden = YES; 165 | }]; 166 | return; 167 | } 168 | 169 | if (_isMoving) { 170 | [self setSidebarOffset:offsetX]; 171 | } 172 | 173 | } 174 | 175 | #pragma mark - 侧栏出来 176 | /* 177 | * 设置侧栏位置 178 | * 完全不显示时为x=kWidth,显示到最右时x=kWidth-kSidebarWidth 179 | */ 180 | - (void)setSidebarOriginX:(CGFloat)x 181 | { 182 | CGRect rect = self.contentView.frame; 183 | rect.origin.x = x; 184 | [self.contentView setFrame:rect]; 185 | 186 | [self setShadowViewAlpha]; 187 | } 188 | 189 | /* 190 | * 设置侧栏相对于开始点击时的偏移 191 | * offset>0向左,offset<0向右 192 | */ 193 | - (void)setSidebarOffset:(CGFloat)offset 194 | { 195 | CGRect rect = self.contentView.frame; 196 | if (offset < 0) { // 左滑 197 | // 如果不在最左 198 | if (rect.origin.x<0) { 199 | rect.origin.x = startContentOriginX + offset; // 直接向左偏移这么多 200 | if (rect.origin.x > 0) { 201 | rect.origin.x = 0; 202 | } 203 | } 204 | } else { // 右滑 205 | // 如果不在最右 206 | if (rect.origin.x > kSidebarWidth) { 207 | rect.origin.x = startContentOriginX + offset; 208 | if (rect.origin.x < kSidebarWidth) { 209 | rect.origin.x = kSidebarWidth; 210 | } 211 | } 212 | } 213 | [self.contentView setFrame:rect]; 214 | [self setShadowViewAlpha]; 215 | 216 | } 217 | 218 | - (void)setShadowViewAlpha 219 | { 220 | self.shadowView.alpha = 0.4; 221 | self.contentView.backgroundColor = _bgColor; 222 | } 223 | 224 | - (void)setBgColor:(UIColor *)color{ 225 | _bgColor = color; 226 | } 227 | 228 | - (void)didReceiveMemoryWarning { 229 | [super didReceiveMemoryWarning]; 230 | } 231 | 232 | 233 | @end 234 | -------------------------------------------------------------------------------- /SlideViewForFilter/DetailInfoTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // DetailInfoTableViewCell.h 3 | // Vasse 4 | // 5 | // Created by 饶首建 on 16/5/19. 6 | // Copyright © 2016年 voossi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DetailInfoTableViewCell : UITableViewCell 12 | @property (weak, nonatomic) IBOutlet UIImageView *checkImgView; 13 | @property (weak, nonatomic) IBOutlet UILabel *detailLabel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SlideViewForFilter/DetailInfoTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // DetailInfoTableViewCell.m 3 | // Vasse 4 | // 5 | // Created by 饶首建 on 16/5/19. 6 | // Copyright © 2016年 voossi. All rights reserved. 7 | // 8 | 9 | #import "DetailInfoTableViewCell.h" 10 | 11 | @implementation DetailInfoTableViewCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | // Initialization code 16 | } 17 | 18 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 19 | [super setSelected:selected animated:animated]; 20 | 21 | // Configure the view for the selected state 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /SlideViewForFilter/DetailInfoTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 26 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /SlideViewForFilter/FilterSlideDataViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FilterSlideViewController.h 3 | // Vasse 4 | // 5 | // Created by 饶首建 on 16/5/19. 6 | // Copyright © 2016年 voossi. All rights reserved. 7 | // 8 | 9 | #import "CustomSlideBar.h" 10 | 11 | @interface FilterSlideDataViewController : CustomSlideBar 12 | 13 | @property (nonatomic, strong)void (^backBlock)(id backData); 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SlideViewForFilter/FilterSlideDataViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FilterSlideViewController.m 3 | // Vasse 4 | // 5 | // Created by 饶首建 on 16/5/19. 6 | // Copyright © 2016年 voossi. All rights reserved. 7 | // 8 | 9 | #import "FilterSlideDataViewController.h" 10 | #import "InfoTableViewCell.h" 11 | #import "DetailInfoTableViewCell.h" 12 | 13 | @interface FilterSlideDataViewController (){ 14 | CGRect _frame; 15 | UIButton *_sureBtn; 16 | UIButton *_resetBtn; 17 | UIButton *_backBtn; 18 | UIImageView *_backImgView; 19 | 20 | NSArray *_provinceArray; 21 | NSArray *_cityArray; 22 | 23 | NSArray *_firstArray; 24 | 25 | NSArray *_otherTableDatasource; 26 | NSInteger _otherTableDataType; 27 | 28 | NSString *_choosedProvince; 29 | NSString *_choosedCity; 30 | } 31 | 32 | @property (nonatomic, strong) UITableView * menuTableView;//一级页面Table 33 | @property (nonatomic, strong) UIView * otherContainerView;//二级页面容器 34 | @property (nonatomic, strong) UITableView * otherTableView;//二级页面Table,显示省、市 35 | 36 | @end 37 | 38 | @implementation FilterSlideDataViewController 39 | 40 | - (void)viewDidLoad { 41 | [super viewDidLoad]; 42 | [self initView]; 43 | [self initData]; 44 | } 45 | 46 | - (void)initView{ 47 | #pragma mark 一级页面 48 | CGRect wsframe = self.contentView.bounds; 49 | wsframe.origin.y = 20; 50 | wsframe.size.height = wsframe.size.height - 48; 51 | self.menuTableView = [[UITableView alloc] initWithFrame:wsframe style:UITableViewStyleGrouped]; 52 | [self.menuTableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; 53 | self.menuTableView.backgroundColor = [UIColor whiteColor]; 54 | self.menuTableView.delegate = self; 55 | self.menuTableView.dataSource = self; 56 | self.menuTableView.showsVerticalScrollIndicator = NO; 57 | [self.contentView addSubview:self.menuTableView]; 58 | //重置 59 | _resetBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 60 | _resetBtn.frame = CGRectMake(0, kSBHeight - 48, kSidebarWidth*0.5, 48); 61 | _resetBtn.backgroundColor = [UIColor lightGrayColor]; 62 | [_resetBtn setTitle:@"重置" forState:UIControlStateNormal]; 63 | _resetBtn.titleLabel.font = [UIFont systemFontOfSize:16]; 64 | [_resetBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 65 | [_resetBtn addTarget:self action:@selector(resetAction) forControlEvents:UIControlEventTouchUpInside]; 66 | [self.contentView addSubview:_resetBtn]; 67 | //确定 68 | _sureBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 69 | _sureBtn.frame = CGRectMake(kSidebarWidth*0.5, kSBHeight - 48, kSidebarWidth*0.5, 48); 70 | _sureBtn.backgroundColor = [UIColor greenColor]; 71 | [_sureBtn setTitle:@"确定" forState:UIControlStateNormal]; 72 | _sureBtn.titleLabel.font = [UIFont systemFontOfSize:16]; 73 | [_sureBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 74 | [_sureBtn addTarget:self action:@selector(sureAction) forControlEvents:UIControlEventTouchUpInside]; 75 | [self.contentView addSubview:_sureBtn]; 76 | 77 | //二级页面 78 | #pragma mark 二级页面 79 | _frame = self.contentView.bounds; 80 | _frame.origin.y = 0; 81 | _frame.origin.x = _frame.size.width; 82 | 83 | _otherContainerView = [[UIView alloc]initWithFrame:_frame]; 84 | _otherContainerView.backgroundColor = [UIColor whiteColor]; 85 | [self.contentView addSubview:_otherContainerView]; 86 | //返回 87 | _backImgView = [[UIImageView alloc]initWithFrame:CGRectMake(20, 30, 13, 21)]; 88 | _backImgView.image = [UIImage imageNamed:@"icon_Back Chevron"]; 89 | [_otherContainerView addSubview:_backImgView]; 90 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(backAction)]; 91 | _backImgView.userInteractionEnabled = YES; 92 | [_backImgView addGestureRecognizer:tap]; 93 | //线 94 | UIView *line = [[UIView alloc]initWithFrame:CGRectMake(0, 63.5, self.contentView.bounds.size.width, 0.5)]; 95 | line.backgroundColor = [UIColor lightGrayColor]; 96 | [_otherContainerView addSubview:line]; 97 | 98 | //省、市 99 | _otherTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, _frame.size.width, _frame.size.height-64)]; 100 | [_otherTableView setSeparatorStyle:UITableViewCellSeparatorStyleSingleLine]; 101 | _otherTableView.showsVerticalScrollIndicator = NO; 102 | _otherTableView.delegate = self; 103 | _otherTableView.dataSource = self; 104 | [_otherContainerView addSubview:_otherTableView]; 105 | 106 | //添加右滑监测 107 | UIPanGestureRecognizer* panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panAction:)]; 108 | [panGesture delaysTouchesBegan]; 109 | [self.view addGestureRecognizer:panGesture]; 110 | } 111 | 112 | - (void)initData{ 113 | _firstArray = @[@"省份",@"城市"]; 114 | _provinceArray = @[@"四川",@"湖南",@"山东",@"陕西"]; 115 | _cityArray = @[@"成都",@"长沙",@"青岛",@"西安",@"南宁"]; 116 | [_menuTableView reloadData]; 117 | } 118 | 119 | #pragma mark --------按钮点击事件 120 | //返回 121 | - (void)backAction{ 122 | [self hideOtherTableView]; 123 | } 124 | //重置 125 | - (void)resetAction{ 126 | //重置搜索条件 127 | _choosedProvince = @""; 128 | _choosedCity = @""; 129 | [self.menuTableView reloadData]; 130 | } 131 | //确定 132 | - (void)sureAction{ 133 | [self showHideSidebar]; 134 | } 135 | //父类方法,当slidebar隐藏时调用 136 | - (void)slideToRight{ 137 | _backBlock([NSString stringWithFormat:@"%@%@",_choosedProvince,_choosedCity]); 138 | } 139 | //父类方法,当slidebar出现时调用 140 | - (void)sidebarDidShown{ 141 | [_menuTableView reloadData]; 142 | } 143 | //滑动手势 144 | - (void)panAction:(UIPanGestureRecognizer*)recoginzer{ 145 | [self panDetected:recoginzer]; 146 | } 147 | //一级页面 tableView中按钮点击事件 148 | #pragma mark - private 149 | - (void)showOtherTableView{ 150 | [UIView animateWithDuration:0.2 animations:^{ 151 | _frame.origin.x = 0; 152 | _otherContainerView.frame = _frame; 153 | }]; 154 | } 155 | 156 | - (void)hideOtherTableView{ 157 | [UIView animateWithDuration:0.2 animations:^{ 158 | _frame.origin.x = _frame.size.width; 159 | _otherContainerView.frame = _frame; 160 | }]; 161 | } 162 | 163 | #pragma mark - TableView 164 | 165 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 166 | if (tableView == _menuTableView) { 167 | return _firstArray.count; 168 | }else if (tableView == _otherTableView){ 169 | return _otherTableDatasource.count; 170 | } 171 | return 0; 172 | } 173 | 174 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ 175 | return 46; 176 | } 177 | 178 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 179 | NSInteger row = indexPath.row; 180 | if (tableView == _menuTableView) { 181 | InfoTableViewCell *cell = [[[NSBundle mainBundle]loadNibNamed:@"InfoTableViewCell" owner:self options:nil]firstObject]; 182 | if (row == 0) { 183 | cell.typeLabel.text = @"省份"; 184 | cell.detailLabel.text = _choosedProvince; 185 | }else{ 186 | cell.typeLabel.text = @"城市"; 187 | cell.detailLabel.text = _choosedCity; 188 | } 189 | return cell; 190 | }else if(tableView == _otherTableView){ 191 | static NSString *detailCellIdentifier = @"detailCellIdentifier"; 192 | DetailInfoTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:detailCellIdentifier]; 193 | if(!cell) { 194 | cell = [[[NSBundle mainBundle]loadNibNamed:@"DetailInfoTableViewCell" owner:self options:nil]firstObject]; 195 | } 196 | cell.detailLabel.text = _otherTableDatasource[indexPath.row]; 197 | if ([_otherTableDatasource[indexPath.row] isEqual:_choosedProvince]||[_otherTableDatasource[indexPath.row] isEqual:_choosedCity]) { 198 | cell.checkImgView.hidden = NO; 199 | }else{ 200 | cell.checkImgView.hidden = YES; 201 | } 202 | return cell; 203 | } 204 | return [[UITableViewCell alloc]init]; 205 | } 206 | 207 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 208 | { 209 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 210 | NSInteger row = indexPath.row; 211 | if (tableView == _menuTableView) { 212 | if (row == 0) { 213 | //准备省份数据 214 | _otherTableDataType = 1; 215 | _otherTableDatasource = _provinceArray; 216 | }else if (row == 1){//准备城市数据 217 | _otherTableDataType = 2; 218 | _otherTableDatasource = _cityArray; 219 | } 220 | [_otherTableView reloadData]; 221 | [self showOtherTableView]; 222 | }else if(tableView == _otherTableView){ 223 | if (_otherTableDataType == 1) {//选择省份 224 | _choosedProvince = _otherTableDatasource[row]; 225 | }else if (_otherTableDataType == 2){ //选择市 226 | _choosedCity = _otherTableDatasource[row]; 227 | } 228 | [_menuTableView reloadData]; 229 | [self hideOtherTableView]; 230 | } 231 | } 232 | 233 | - (void)didReceiveMemoryWarning { 234 | [super didReceiveMemoryWarning]; 235 | // Dispose of any resources that can be recreated. 236 | } 237 | 238 | @end 239 | -------------------------------------------------------------------------------- /SlideViewForFilter/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /SlideViewForFilter/InfoTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // InfoTableViewCell.h 3 | // Vasse 4 | // 5 | // Created by 饶首建 on 16/5/19. 6 | // Copyright © 2016年 voossi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface InfoTableViewCell : UITableViewCell 12 | @property (weak, nonatomic) IBOutlet UILabel *detailLabel; 13 | @property (weak, nonatomic) IBOutlet UILabel *typeLabel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SlideViewForFilter/InfoTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // InfoTableViewCell.m 3 | // Vasse 4 | // 5 | // Created by 饶首建 on 16/5/19. 6 | // Copyright © 2016年 voossi. All rights reserved. 7 | // 8 | 9 | #import "InfoTableViewCell.h" 10 | 11 | @implementation InfoTableViewCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | // Initialization code icon_Disclosure Indicator 16 | } 17 | 18 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 19 | [super setSelected:selected animated:animated]; 20 | 21 | // Configure the view for the selected state 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /SlideViewForFilter/InfoTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /SlideViewForFilter/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // SlideViewForFilter 4 | // 5 | // Created by 饶首建 on 16/5/27. 6 | // Copyright © 2016年 wings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /SlideViewForFilter/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // SlideViewForFilter 4 | // 5 | // Created by 饶首建 on 16/5/27. 6 | // Copyright © 2016年 wings. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "FilterSlideDataViewController.h" 11 | 12 | @interface ViewController () 13 | @property (weak, nonatomic) IBOutlet UILabel *label; 14 | 15 | @property (nonatomic, strong) FilterSlideDataViewController* slidebarVC; 16 | 17 | @end 18 | 19 | @implementation ViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | // Do any additional setup after loading the view, typically from a nib. 24 | } 25 | - (IBAction)filterAction:(id)sender { 26 | //侧滑FilterSlideViewController 27 | _slidebarVC = [[FilterSlideDataViewController alloc] init]; 28 | _slidebarVC.view.frame = [UIScreen mainScreen].bounds; 29 | [self.view addSubview:_slidebarVC.view]; 30 | [_slidebarVC showHideSidebar]; 31 | 32 | __weak typeof(self) weakSelf = self; 33 | _slidebarVC.backBlock = ^(id backData){ 34 | if ([NSString stringWithFormat:@"%@",backData].length) { 35 | weakSelf.label.text = backData; 36 | } 37 | }; 38 | } 39 | 40 | - (void)didReceiveMemoryWarning { 41 | [super didReceiveMemoryWarning]; 42 | // Dispose of any resources that can be recreated. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /SlideViewForFilter/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SlideViewForFilter 4 | // 5 | // Created by 饶首建 on 16/5/27. 6 | // Copyright © 2016年 wings. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SlideViewForFilterTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SlideViewForFilterTests/SlideViewForFilterTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SlideViewForFilterTests.m 3 | // SlideViewForFilterTests 4 | // 5 | // Created by 饶首建 on 16/5/27. 6 | // Copyright © 2016年 wings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SlideViewForFilterTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation SlideViewForFilterTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | --------------------------------------------------------------------------------