├── .gitignore ├── LICENSE ├── README.md ├── SlideViewControllerDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── Dahan_payMore.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Dahan_payMore.xcuserdatad │ └── xcschemes │ ├── SlideViewControllerDemo.xcscheme │ └── xcschememanagement.plist ├── SlideViewControllerDemo ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── LaunchScreen.xib ├── DHSlideMenuController │ ├── DHSlideMenuController.h │ └── DHSlideMenuController.m ├── DHTabBarPagerView │ ├── DHMenuViewPagerView │ │ ├── DHLandscapeMenuScrollView.h │ │ ├── DHLandscapeMenuScrollView.m │ │ ├── DHLandscapeTableView.h │ │ ├── DHLandscapeTableView.m │ │ ├── DHMenuPagerViewController.h │ │ └── DHMenuPagerViewController.m │ ├── DHTabBarViewController.h │ ├── DHTabBarViewController.m │ ├── ParentCellViewController.h │ └── ParentCellViewController.m ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── MenuTableController.h ├── MenuTableController.m ├── NavOneController.h ├── NavOneController.m ├── NavParentController.h ├── NavParentController.m ├── NavThreeController.h ├── NavThreeController.m ├── NavTwoController.h ├── NavTwoController.m ├── ToggleMenu.png ├── ViewController.h ├── ViewController.m ├── main.m ├── nav_bg.png ├── slide.gif ├── tab_bg.png ├── tab_bg_pressed.png ├── tabbar_discover.png └── tabbar_discover_highlighted.png └── SlideViewControllerDemoTests ├── Info.plist └── SlideViewControllerDemoTests.m /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 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 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | *.DS_Store 20 | 21 | # CocoaPods 22 | # 23 | # We recommend against adding the Pods directory to your .gitignore. However 24 | # you should judge for yourself, the pros and cons are mentioned at: 25 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 26 | # 27 | # Pods/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Dahan Hu 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. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SlideViewControllerDemo 2 | ======================= 3 | 4 | ######正如下图中所见,Demo整合了Nav,Tab,ViewPager,SideView,以及TapGesture等常用容器,并且每种容器都进行了必要的封装以便于使用,当然,每一个容器都可以再次的自定义 5 | SlideViewController
6 | 7 | How to use 8 | ========== 9 | 10 | ######上面说过,本Demo只是多个容器(已经在下面给出了链接)整合出来的界面,并没有对所有的容器进行再封装,所以没有实例化方法,以下是整合过程: 11 | ####1. [DHSlideMenuController](https://github.com/DahanHu/DHSlideMenuController)作为整个App的根视图ViewController
12 | 13 | DHSlideMenuController *rootVC = [DHSlideMenuController sharedInstance]; 14 | rootVC.mainViewController = mainViewController; 15 | rootVC.leftViewController = leftViewController; 16 | rootVC.rightViewController = rightViewController; 17 | 18 | ####2. [DHTabBarMenuViewPager](https://github.com/DahanHu/DHTabBarMenuViewPager)作为DHSlideMenuController的mainViewController,至于leftViewController和rightViewController应该至少有一个,否则就没有意义了,对吧 19 | 20 | DHTabBarViewController *mainViewController = [[DHTabBarViewController alloc] 21 | initWithChildViewControllers:YourViewControllersArray 22 | tabTitles:YourTitleArray tabImages:YourImagesArray 23 | selectedImages:YourSelectedImagesArray 24 | backgroundImage:TabBarBackgroundImageName 25 | selectionIndicatorImage:SelectedTabBackgroundImageName]; 26 | 27 | ####3. [DHMenuViewPager](https://github.com/DahanHu/DHMenuViewPager)就是ViewPager容器,我们需要把他作为DHTabBarMenuViewPager的viewControllers添加到DHMenuViewPager中去 28 | 29 | DHMenuPagerViewController *pagerView = [[DHMenuPagerViewController alloc] 30 | initWithViewControllers:YourViewControllersArray 31 | titles:TitleViewTitles menuBackgroundColor:YouColoredIt titleColor:YouColoredIt; 32 | 33 | ####4. 但是我们的例子是有NavigationBar的,所以就索性把DHMenuViewPager给Embed In NavigationController中去,这里我用一个继承自UINavigationController类的[NavParentController](./SlideViewControllerDemo/NavParentController.m)类来为Nav作通用配置 34 | 35 | UINavigationController [[NavTwoController alloc] initWithRootViewController:pagerView]; 36 | 37 | Tips 38 | ====== 39 | 请留意[AppDelegate.m](./SlideViewControllerDemo/AppDelegate.m)文件,并且注意每一个容器使用的层次关系,Tab中的每一个ContentViewController都需要继承自NavParentController 40 | 41 | Thanks 42 | ====== 43 | 44 | 本Demo属于入门级,如果你有更好的实现方式,不妨fork一下,在代码中体现出来,或是我的思路和方式不可取,欢迎指正,我表示由衷的感谢! 45 | 46 | License 47 | ======= 48 | 49 | These specifications and CocoaPods are available under the [MIT license](http://opensource.org/licenses/mit-license.php). 50 | -------------------------------------------------------------------------------- /SlideViewControllerDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5B5D9DD319FA1A870091C4D2 /* slide.gif in Resources */ = {isa = PBXBuildFile; fileRef = 5B5D9DD219FA1A870091C4D2 /* slide.gif */; }; 11 | 5BF27D2219F0ADA60095224C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF27D2119F0ADA60095224C /* main.m */; }; 12 | 5BF27D2D19F0ADA60095224C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5BF27D2C19F0ADA60095224C /* Images.xcassets */; }; 13 | 5BF27D3019F0ADA60095224C /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BF27D2E19F0ADA60095224C /* LaunchScreen.xib */; }; 14 | 5BF27D3C19F0ADA60095224C /* SlideViewControllerDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF27D3B19F0ADA60095224C /* SlideViewControllerDemoTests.m */; }; 15 | 5BF27D5419F0AE330095224C /* DHSlideMenuController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF27D4719F0AE330095224C /* DHSlideMenuController.m */; }; 16 | 5BF27D5519F0AE330095224C /* DHLandscapeMenuScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF27D4B19F0AE330095224C /* DHLandscapeMenuScrollView.m */; }; 17 | 5BF27D5619F0AE330095224C /* DHLandscapeTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF27D4D19F0AE330095224C /* DHLandscapeTableView.m */; }; 18 | 5BF27D5719F0AE330095224C /* DHMenuPagerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF27D4F19F0AE330095224C /* DHMenuPagerViewController.m */; }; 19 | 5BF27D5819F0AE330095224C /* DHTabBarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF27D5119F0AE330095224C /* DHTabBarViewController.m */; }; 20 | 5BF27D5919F0AE330095224C /* ParentCellViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF27D5319F0AE330095224C /* ParentCellViewController.m */; }; 21 | 5BF27D5B19F0AE580095224C /* ToggleMenu.png in Resources */ = {isa = PBXBuildFile; fileRef = 5BF27D5A19F0AE580095224C /* ToggleMenu.png */; }; 22 | 5BF27D5D19F0AE680095224C /* nav_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = 5BF27D5C19F0AE680095224C /* nav_bg.png */; }; 23 | 5BF27D5F19F0AE700095224C /* tab_bg_pressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 5BF27D5E19F0AE700095224C /* tab_bg_pressed.png */; }; 24 | 5BF27D6119F0AE780095224C /* tab_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = 5BF27D6019F0AE780095224C /* tab_bg.png */; }; 25 | 5BF27D6319F0AE7F0095224C /* tabbar_discover_highlighted.png in Resources */ = {isa = PBXBuildFile; fileRef = 5BF27D6219F0AE7F0095224C /* tabbar_discover_highlighted.png */; }; 26 | 5BF27D6519F0AE850095224C /* tabbar_discover.png in Resources */ = {isa = PBXBuildFile; fileRef = 5BF27D6419F0AE850095224C /* tabbar_discover.png */; }; 27 | 5BF27D6E19F0AEA30095224C /* NavOneController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF27D6719F0AEA30095224C /* NavOneController.m */; }; 28 | 5BF27D6F19F0AEA30095224C /* NavParentController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF27D6919F0AEA30095224C /* NavParentController.m */; }; 29 | 5BF27D7019F0AEA30095224C /* NavThreeController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF27D6B19F0AEA30095224C /* NavThreeController.m */; }; 30 | 5BF27D7119F0AEA30095224C /* NavTwoController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF27D6D19F0AEA30095224C /* NavTwoController.m */; }; 31 | 5BF27D7619F0AED50095224C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF27D7319F0AED50095224C /* AppDelegate.m */; }; 32 | 5BF27D7719F0AED50095224C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF27D7519F0AED50095224C /* ViewController.m */; }; 33 | CF1D31381C5B43F8007E7023 /* MenuTableController.m in Sources */ = {isa = PBXBuildFile; fileRef = CF1D31371C5B43F8007E7023 /* MenuTableController.m */; }; 34 | /* End PBXBuildFile section */ 35 | 36 | /* Begin PBXContainerItemProxy section */ 37 | 5BF27D3619F0ADA60095224C /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 5BF27D1419F0ADA50095224C /* Project object */; 40 | proxyType = 1; 41 | remoteGlobalIDString = 5BF27D1B19F0ADA60095224C; 42 | remoteInfo = SlideViewControllerDemo; 43 | }; 44 | /* End PBXContainerItemProxy section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | 5B5D9DD219FA1A870091C4D2 /* slide.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = slide.gif; sourceTree = ""; }; 48 | 5BF27D1C19F0ADA60095224C /* SlideViewControllerDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SlideViewControllerDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 5BF27D2019F0ADA60095224C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | 5BF27D2119F0ADA60095224C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 51 | 5BF27D2C19F0ADA60095224C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 52 | 5BF27D2F19F0ADA60095224C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 53 | 5BF27D3519F0ADA60095224C /* SlideViewControllerDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SlideViewControllerDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 5BF27D3A19F0ADA60095224C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 5BF27D3B19F0ADA60095224C /* SlideViewControllerDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SlideViewControllerDemoTests.m; sourceTree = ""; }; 56 | 5BF27D4619F0AE330095224C /* DHSlideMenuController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DHSlideMenuController.h; sourceTree = ""; }; 57 | 5BF27D4719F0AE330095224C /* DHSlideMenuController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DHSlideMenuController.m; sourceTree = ""; }; 58 | 5BF27D4A19F0AE330095224C /* DHLandscapeMenuScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DHLandscapeMenuScrollView.h; sourceTree = ""; }; 59 | 5BF27D4B19F0AE330095224C /* DHLandscapeMenuScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DHLandscapeMenuScrollView.m; sourceTree = ""; }; 60 | 5BF27D4C19F0AE330095224C /* DHLandscapeTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DHLandscapeTableView.h; sourceTree = ""; }; 61 | 5BF27D4D19F0AE330095224C /* DHLandscapeTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DHLandscapeTableView.m; sourceTree = ""; }; 62 | 5BF27D4E19F0AE330095224C /* DHMenuPagerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DHMenuPagerViewController.h; sourceTree = ""; }; 63 | 5BF27D4F19F0AE330095224C /* DHMenuPagerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DHMenuPagerViewController.m; sourceTree = ""; }; 64 | 5BF27D5019F0AE330095224C /* DHTabBarViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DHTabBarViewController.h; sourceTree = ""; }; 65 | 5BF27D5119F0AE330095224C /* DHTabBarViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DHTabBarViewController.m; sourceTree = ""; }; 66 | 5BF27D5219F0AE330095224C /* ParentCellViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParentCellViewController.h; sourceTree = ""; }; 67 | 5BF27D5319F0AE330095224C /* ParentCellViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ParentCellViewController.m; sourceTree = ""; }; 68 | 5BF27D5A19F0AE580095224C /* ToggleMenu.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ToggleMenu.png; sourceTree = ""; }; 69 | 5BF27D5C19F0AE680095224C /* nav_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = nav_bg.png; sourceTree = ""; }; 70 | 5BF27D5E19F0AE700095224C /* tab_bg_pressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_bg_pressed.png; sourceTree = ""; }; 71 | 5BF27D6019F0AE780095224C /* tab_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_bg.png; sourceTree = ""; }; 72 | 5BF27D6219F0AE7F0095224C /* tabbar_discover_highlighted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tabbar_discover_highlighted.png; sourceTree = ""; }; 73 | 5BF27D6419F0AE850095224C /* tabbar_discover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tabbar_discover.png; sourceTree = ""; }; 74 | 5BF27D6619F0AEA30095224C /* NavOneController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavOneController.h; sourceTree = ""; }; 75 | 5BF27D6719F0AEA30095224C /* NavOneController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NavOneController.m; sourceTree = ""; }; 76 | 5BF27D6819F0AEA30095224C /* NavParentController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavParentController.h; sourceTree = ""; }; 77 | 5BF27D6919F0AEA30095224C /* NavParentController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NavParentController.m; sourceTree = ""; }; 78 | 5BF27D6A19F0AEA30095224C /* NavThreeController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavThreeController.h; sourceTree = ""; }; 79 | 5BF27D6B19F0AEA30095224C /* NavThreeController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NavThreeController.m; sourceTree = ""; }; 80 | 5BF27D6C19F0AEA30095224C /* NavTwoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavTwoController.h; sourceTree = ""; }; 81 | 5BF27D6D19F0AEA30095224C /* NavTwoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NavTwoController.m; sourceTree = ""; }; 82 | 5BF27D7219F0AED50095224C /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 83 | 5BF27D7319F0AED50095224C /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 84 | 5BF27D7419F0AED50095224C /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 85 | 5BF27D7519F0AED50095224C /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 86 | CF1D31361C5B43F8007E7023 /* MenuTableController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuTableController.h; sourceTree = ""; }; 87 | CF1D31371C5B43F8007E7023 /* MenuTableController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuTableController.m; sourceTree = ""; }; 88 | /* End PBXFileReference section */ 89 | 90 | /* Begin PBXFrameworksBuildPhase section */ 91 | 5BF27D1919F0ADA60095224C /* Frameworks */ = { 92 | isa = PBXFrameworksBuildPhase; 93 | buildActionMask = 2147483647; 94 | files = ( 95 | ); 96 | runOnlyForDeploymentPostprocessing = 0; 97 | }; 98 | 5BF27D3219F0ADA60095224C /* Frameworks */ = { 99 | isa = PBXFrameworksBuildPhase; 100 | buildActionMask = 2147483647; 101 | files = ( 102 | ); 103 | runOnlyForDeploymentPostprocessing = 0; 104 | }; 105 | /* End PBXFrameworksBuildPhase section */ 106 | 107 | /* Begin PBXGroup section */ 108 | 5BA84C2719F0B1B5005D4D18 /* EveryTabContent */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 5BF27D6619F0AEA30095224C /* NavOneController.h */, 112 | 5BF27D6719F0AEA30095224C /* NavOneController.m */, 113 | 5BF27D6819F0AEA30095224C /* NavParentController.h */, 114 | 5BF27D6919F0AEA30095224C /* NavParentController.m */, 115 | 5BF27D6A19F0AEA30095224C /* NavThreeController.h */, 116 | 5BF27D6B19F0AEA30095224C /* NavThreeController.m */, 117 | 5BF27D6C19F0AEA30095224C /* NavTwoController.h */, 118 | 5BF27D6D19F0AEA30095224C /* NavTwoController.m */, 119 | CF1D31361C5B43F8007E7023 /* MenuTableController.h */, 120 | CF1D31371C5B43F8007E7023 /* MenuTableController.m */, 121 | ); 122 | name = EveryTabContent; 123 | sourceTree = ""; 124 | }; 125 | 5BA84C2819F0B1D2005D4D18 /* Resources */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 5BF27D6419F0AE850095224C /* tabbar_discover.png */, 129 | 5BF27D6219F0AE7F0095224C /* tabbar_discover_highlighted.png */, 130 | 5BF27D6019F0AE780095224C /* tab_bg.png */, 131 | 5BF27D5E19F0AE700095224C /* tab_bg_pressed.png */, 132 | 5BF27D5C19F0AE680095224C /* nav_bg.png */, 133 | 5BF27D5A19F0AE580095224C /* ToggleMenu.png */, 134 | ); 135 | name = Resources; 136 | sourceTree = ""; 137 | }; 138 | 5BF27D1319F0ADA50095224C = { 139 | isa = PBXGroup; 140 | children = ( 141 | 5BF27D1E19F0ADA60095224C /* SlideViewControllerDemo */, 142 | 5BF27D3819F0ADA60095224C /* SlideViewControllerDemoTests */, 143 | 5BF27D1D19F0ADA60095224C /* Products */, 144 | ); 145 | sourceTree = ""; 146 | }; 147 | 5BF27D1D19F0ADA60095224C /* Products */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 5BF27D1C19F0ADA60095224C /* SlideViewControllerDemo.app */, 151 | 5BF27D3519F0ADA60095224C /* SlideViewControllerDemoTests.xctest */, 152 | ); 153 | name = Products; 154 | sourceTree = ""; 155 | }; 156 | 5BF27D1E19F0ADA60095224C /* SlideViewControllerDemo */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 5B5D9DD219FA1A870091C4D2 /* slide.gif */, 160 | 5BA84C2719F0B1B5005D4D18 /* EveryTabContent */, 161 | 5BA84C2819F0B1D2005D4D18 /* Resources */, 162 | 5BF27D4519F0AE330095224C /* DHSlideMenuController */, 163 | 5BF27D4819F0AE330095224C /* DHTabBarPagerView */, 164 | 5BF27D1F19F0ADA60095224C /* Supporting Files */, 165 | 5BF27D2C19F0ADA60095224C /* Images.xcassets */, 166 | ); 167 | path = SlideViewControllerDemo; 168 | sourceTree = ""; 169 | }; 170 | 5BF27D1F19F0ADA60095224C /* Supporting Files */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 5BF27D2E19F0ADA60095224C /* LaunchScreen.xib */, 174 | 5BF27D7219F0AED50095224C /* AppDelegate.h */, 175 | 5BF27D7319F0AED50095224C /* AppDelegate.m */, 176 | 5BF27D7419F0AED50095224C /* ViewController.h */, 177 | 5BF27D7519F0AED50095224C /* ViewController.m */, 178 | 5BF27D2019F0ADA60095224C /* Info.plist */, 179 | 5BF27D2119F0ADA60095224C /* main.m */, 180 | ); 181 | name = "Supporting Files"; 182 | sourceTree = ""; 183 | }; 184 | 5BF27D3819F0ADA60095224C /* SlideViewControllerDemoTests */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | 5BF27D3B19F0ADA60095224C /* SlideViewControllerDemoTests.m */, 188 | 5BF27D3919F0ADA60095224C /* Supporting Files */, 189 | ); 190 | path = SlideViewControllerDemoTests; 191 | sourceTree = ""; 192 | }; 193 | 5BF27D3919F0ADA60095224C /* Supporting Files */ = { 194 | isa = PBXGroup; 195 | children = ( 196 | 5BF27D3A19F0ADA60095224C /* Info.plist */, 197 | ); 198 | name = "Supporting Files"; 199 | sourceTree = ""; 200 | }; 201 | 5BF27D4519F0AE330095224C /* DHSlideMenuController */ = { 202 | isa = PBXGroup; 203 | children = ( 204 | 5BF27D4619F0AE330095224C /* DHSlideMenuController.h */, 205 | 5BF27D4719F0AE330095224C /* DHSlideMenuController.m */, 206 | ); 207 | path = DHSlideMenuController; 208 | sourceTree = ""; 209 | }; 210 | 5BF27D4819F0AE330095224C /* DHTabBarPagerView */ = { 211 | isa = PBXGroup; 212 | children = ( 213 | 5BF27D4919F0AE330095224C /* DHMenuViewPagerView */, 214 | 5BF27D5019F0AE330095224C /* DHTabBarViewController.h */, 215 | 5BF27D5119F0AE330095224C /* DHTabBarViewController.m */, 216 | 5BF27D5219F0AE330095224C /* ParentCellViewController.h */, 217 | 5BF27D5319F0AE330095224C /* ParentCellViewController.m */, 218 | ); 219 | path = DHTabBarPagerView; 220 | sourceTree = ""; 221 | }; 222 | 5BF27D4919F0AE330095224C /* DHMenuViewPagerView */ = { 223 | isa = PBXGroup; 224 | children = ( 225 | 5BF27D4A19F0AE330095224C /* DHLandscapeMenuScrollView.h */, 226 | 5BF27D4B19F0AE330095224C /* DHLandscapeMenuScrollView.m */, 227 | 5BF27D4C19F0AE330095224C /* DHLandscapeTableView.h */, 228 | 5BF27D4D19F0AE330095224C /* DHLandscapeTableView.m */, 229 | 5BF27D4E19F0AE330095224C /* DHMenuPagerViewController.h */, 230 | 5BF27D4F19F0AE330095224C /* DHMenuPagerViewController.m */, 231 | ); 232 | path = DHMenuViewPagerView; 233 | sourceTree = ""; 234 | }; 235 | /* End PBXGroup section */ 236 | 237 | /* Begin PBXNativeTarget section */ 238 | 5BF27D1B19F0ADA60095224C /* SlideViewControllerDemo */ = { 239 | isa = PBXNativeTarget; 240 | buildConfigurationList = 5BF27D3F19F0ADA60095224C /* Build configuration list for PBXNativeTarget "SlideViewControllerDemo" */; 241 | buildPhases = ( 242 | 5BF27D1819F0ADA60095224C /* Sources */, 243 | 5BF27D1919F0ADA60095224C /* Frameworks */, 244 | 5BF27D1A19F0ADA60095224C /* Resources */, 245 | ); 246 | buildRules = ( 247 | ); 248 | dependencies = ( 249 | ); 250 | name = SlideViewControllerDemo; 251 | productName = SlideViewControllerDemo; 252 | productReference = 5BF27D1C19F0ADA60095224C /* SlideViewControllerDemo.app */; 253 | productType = "com.apple.product-type.application"; 254 | }; 255 | 5BF27D3419F0ADA60095224C /* SlideViewControllerDemoTests */ = { 256 | isa = PBXNativeTarget; 257 | buildConfigurationList = 5BF27D4219F0ADA60095224C /* Build configuration list for PBXNativeTarget "SlideViewControllerDemoTests" */; 258 | buildPhases = ( 259 | 5BF27D3119F0ADA60095224C /* Sources */, 260 | 5BF27D3219F0ADA60095224C /* Frameworks */, 261 | 5BF27D3319F0ADA60095224C /* Resources */, 262 | ); 263 | buildRules = ( 264 | ); 265 | dependencies = ( 266 | 5BF27D3719F0ADA60095224C /* PBXTargetDependency */, 267 | ); 268 | name = SlideViewControllerDemoTests; 269 | productName = SlideViewControllerDemoTests; 270 | productReference = 5BF27D3519F0ADA60095224C /* SlideViewControllerDemoTests.xctest */; 271 | productType = "com.apple.product-type.bundle.unit-test"; 272 | }; 273 | /* End PBXNativeTarget section */ 274 | 275 | /* Begin PBXProject section */ 276 | 5BF27D1419F0ADA50095224C /* Project object */ = { 277 | isa = PBXProject; 278 | attributes = { 279 | LastUpgradeCheck = 0600; 280 | ORGANIZATIONNAME = HuDahan_payMoreGainMore; 281 | TargetAttributes = { 282 | 5BF27D1B19F0ADA60095224C = { 283 | CreatedOnToolsVersion = 6.0.1; 284 | }; 285 | 5BF27D3419F0ADA60095224C = { 286 | CreatedOnToolsVersion = 6.0.1; 287 | TestTargetID = 5BF27D1B19F0ADA60095224C; 288 | }; 289 | }; 290 | }; 291 | buildConfigurationList = 5BF27D1719F0ADA50095224C /* Build configuration list for PBXProject "SlideViewControllerDemo" */; 292 | compatibilityVersion = "Xcode 3.2"; 293 | developmentRegion = English; 294 | hasScannedForEncodings = 0; 295 | knownRegions = ( 296 | en, 297 | Base, 298 | ); 299 | mainGroup = 5BF27D1319F0ADA50095224C; 300 | productRefGroup = 5BF27D1D19F0ADA60095224C /* Products */; 301 | projectDirPath = ""; 302 | projectRoot = ""; 303 | targets = ( 304 | 5BF27D1B19F0ADA60095224C /* SlideViewControllerDemo */, 305 | 5BF27D3419F0ADA60095224C /* SlideViewControllerDemoTests */, 306 | ); 307 | }; 308 | /* End PBXProject section */ 309 | 310 | /* Begin PBXResourcesBuildPhase section */ 311 | 5BF27D1A19F0ADA60095224C /* Resources */ = { 312 | isa = PBXResourcesBuildPhase; 313 | buildActionMask = 2147483647; 314 | files = ( 315 | 5BF27D6519F0AE850095224C /* tabbar_discover.png in Resources */, 316 | 5B5D9DD319FA1A870091C4D2 /* slide.gif in Resources */, 317 | 5BF27D6319F0AE7F0095224C /* tabbar_discover_highlighted.png in Resources */, 318 | 5BF27D5B19F0AE580095224C /* ToggleMenu.png in Resources */, 319 | 5BF27D3019F0ADA60095224C /* LaunchScreen.xib in Resources */, 320 | 5BF27D5F19F0AE700095224C /* tab_bg_pressed.png in Resources */, 321 | 5BF27D5D19F0AE680095224C /* nav_bg.png in Resources */, 322 | 5BF27D6119F0AE780095224C /* tab_bg.png in Resources */, 323 | 5BF27D2D19F0ADA60095224C /* Images.xcassets in Resources */, 324 | ); 325 | runOnlyForDeploymentPostprocessing = 0; 326 | }; 327 | 5BF27D3319F0ADA60095224C /* Resources */ = { 328 | isa = PBXResourcesBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | ); 332 | runOnlyForDeploymentPostprocessing = 0; 333 | }; 334 | /* End PBXResourcesBuildPhase section */ 335 | 336 | /* Begin PBXSourcesBuildPhase section */ 337 | 5BF27D1819F0ADA60095224C /* Sources */ = { 338 | isa = PBXSourcesBuildPhase; 339 | buildActionMask = 2147483647; 340 | files = ( 341 | 5BF27D5419F0AE330095224C /* DHSlideMenuController.m in Sources */, 342 | CF1D31381C5B43F8007E7023 /* MenuTableController.m in Sources */, 343 | 5BF27D5919F0AE330095224C /* ParentCellViewController.m in Sources */, 344 | 5BF27D5819F0AE330095224C /* DHTabBarViewController.m in Sources */, 345 | 5BF27D7019F0AEA30095224C /* NavThreeController.m in Sources */, 346 | 5BF27D5719F0AE330095224C /* DHMenuPagerViewController.m in Sources */, 347 | 5BF27D7119F0AEA30095224C /* NavTwoController.m in Sources */, 348 | 5BF27D7719F0AED50095224C /* ViewController.m in Sources */, 349 | 5BF27D5619F0AE330095224C /* DHLandscapeTableView.m in Sources */, 350 | 5BF27D2219F0ADA60095224C /* main.m in Sources */, 351 | 5BF27D7619F0AED50095224C /* AppDelegate.m in Sources */, 352 | 5BF27D6F19F0AEA30095224C /* NavParentController.m in Sources */, 353 | 5BF27D6E19F0AEA30095224C /* NavOneController.m in Sources */, 354 | 5BF27D5519F0AE330095224C /* DHLandscapeMenuScrollView.m in Sources */, 355 | ); 356 | runOnlyForDeploymentPostprocessing = 0; 357 | }; 358 | 5BF27D3119F0ADA60095224C /* Sources */ = { 359 | isa = PBXSourcesBuildPhase; 360 | buildActionMask = 2147483647; 361 | files = ( 362 | 5BF27D3C19F0ADA60095224C /* SlideViewControllerDemoTests.m in Sources */, 363 | ); 364 | runOnlyForDeploymentPostprocessing = 0; 365 | }; 366 | /* End PBXSourcesBuildPhase section */ 367 | 368 | /* Begin PBXTargetDependency section */ 369 | 5BF27D3719F0ADA60095224C /* PBXTargetDependency */ = { 370 | isa = PBXTargetDependency; 371 | target = 5BF27D1B19F0ADA60095224C /* SlideViewControllerDemo */; 372 | targetProxy = 5BF27D3619F0ADA60095224C /* PBXContainerItemProxy */; 373 | }; 374 | /* End PBXTargetDependency section */ 375 | 376 | /* Begin PBXVariantGroup section */ 377 | 5BF27D2E19F0ADA60095224C /* LaunchScreen.xib */ = { 378 | isa = PBXVariantGroup; 379 | children = ( 380 | 5BF27D2F19F0ADA60095224C /* Base */, 381 | ); 382 | name = LaunchScreen.xib; 383 | sourceTree = ""; 384 | }; 385 | /* End PBXVariantGroup section */ 386 | 387 | /* Begin XCBuildConfiguration section */ 388 | 5BF27D3D19F0ADA60095224C /* Debug */ = { 389 | isa = XCBuildConfiguration; 390 | buildSettings = { 391 | ALWAYS_SEARCH_USER_PATHS = NO; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_CXX_LIBRARY = "libc++"; 394 | CLANG_ENABLE_MODULES = YES; 395 | CLANG_ENABLE_OBJC_ARC = YES; 396 | CLANG_WARN_BOOL_CONVERSION = YES; 397 | CLANG_WARN_CONSTANT_CONVERSION = YES; 398 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 399 | CLANG_WARN_EMPTY_BODY = YES; 400 | CLANG_WARN_ENUM_CONVERSION = YES; 401 | CLANG_WARN_INT_CONVERSION = YES; 402 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 403 | CLANG_WARN_UNREACHABLE_CODE = YES; 404 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 405 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 406 | COPY_PHASE_STRIP = NO; 407 | ENABLE_STRICT_OBJC_MSGSEND = YES; 408 | GCC_C_LANGUAGE_STANDARD = gnu99; 409 | GCC_DYNAMIC_NO_PIC = NO; 410 | GCC_OPTIMIZATION_LEVEL = 0; 411 | GCC_PREPROCESSOR_DEFINITIONS = ( 412 | "DEBUG=1", 413 | "$(inherited)", 414 | ); 415 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 416 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 417 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 418 | GCC_WARN_UNDECLARED_SELECTOR = YES; 419 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 420 | GCC_WARN_UNUSED_FUNCTION = YES; 421 | GCC_WARN_UNUSED_VARIABLE = YES; 422 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 423 | MTL_ENABLE_DEBUG_INFO = YES; 424 | ONLY_ACTIVE_ARCH = YES; 425 | SDKROOT = iphoneos; 426 | TARGETED_DEVICE_FAMILY = "1,2"; 427 | }; 428 | name = Debug; 429 | }; 430 | 5BF27D3E19F0ADA60095224C /* Release */ = { 431 | isa = XCBuildConfiguration; 432 | buildSettings = { 433 | ALWAYS_SEARCH_USER_PATHS = NO; 434 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 435 | CLANG_CXX_LIBRARY = "libc++"; 436 | CLANG_ENABLE_MODULES = YES; 437 | CLANG_ENABLE_OBJC_ARC = YES; 438 | CLANG_WARN_BOOL_CONVERSION = YES; 439 | CLANG_WARN_CONSTANT_CONVERSION = YES; 440 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 441 | CLANG_WARN_EMPTY_BODY = YES; 442 | CLANG_WARN_ENUM_CONVERSION = YES; 443 | CLANG_WARN_INT_CONVERSION = YES; 444 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 445 | CLANG_WARN_UNREACHABLE_CODE = YES; 446 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 447 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 448 | COPY_PHASE_STRIP = YES; 449 | ENABLE_NS_ASSERTIONS = NO; 450 | ENABLE_STRICT_OBJC_MSGSEND = YES; 451 | GCC_C_LANGUAGE_STANDARD = gnu99; 452 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 453 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 454 | GCC_WARN_UNDECLARED_SELECTOR = YES; 455 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 456 | GCC_WARN_UNUSED_FUNCTION = YES; 457 | GCC_WARN_UNUSED_VARIABLE = YES; 458 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 459 | MTL_ENABLE_DEBUG_INFO = NO; 460 | SDKROOT = iphoneos; 461 | TARGETED_DEVICE_FAMILY = "1,2"; 462 | VALIDATE_PRODUCT = YES; 463 | }; 464 | name = Release; 465 | }; 466 | 5BF27D4019F0ADA60095224C /* Debug */ = { 467 | isa = XCBuildConfiguration; 468 | buildSettings = { 469 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 470 | INFOPLIST_FILE = SlideViewControllerDemo/Info.plist; 471 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 472 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 473 | PRODUCT_NAME = "$(TARGET_NAME)"; 474 | }; 475 | name = Debug; 476 | }; 477 | 5BF27D4119F0ADA60095224C /* Release */ = { 478 | isa = XCBuildConfiguration; 479 | buildSettings = { 480 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 481 | INFOPLIST_FILE = SlideViewControllerDemo/Info.plist; 482 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 483 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 484 | PRODUCT_NAME = "$(TARGET_NAME)"; 485 | }; 486 | name = Release; 487 | }; 488 | 5BF27D4319F0ADA60095224C /* Debug */ = { 489 | isa = XCBuildConfiguration; 490 | buildSettings = { 491 | BUNDLE_LOADER = "$(TEST_HOST)"; 492 | FRAMEWORK_SEARCH_PATHS = ( 493 | "$(SDKROOT)/Developer/Library/Frameworks", 494 | "$(inherited)", 495 | ); 496 | GCC_PREPROCESSOR_DEFINITIONS = ( 497 | "DEBUG=1", 498 | "$(inherited)", 499 | ); 500 | INFOPLIST_FILE = SlideViewControllerDemoTests/Info.plist; 501 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 502 | PRODUCT_NAME = "$(TARGET_NAME)"; 503 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SlideViewControllerDemo.app/SlideViewControllerDemo"; 504 | }; 505 | name = Debug; 506 | }; 507 | 5BF27D4419F0ADA60095224C /* Release */ = { 508 | isa = XCBuildConfiguration; 509 | buildSettings = { 510 | BUNDLE_LOADER = "$(TEST_HOST)"; 511 | FRAMEWORK_SEARCH_PATHS = ( 512 | "$(SDKROOT)/Developer/Library/Frameworks", 513 | "$(inherited)", 514 | ); 515 | INFOPLIST_FILE = SlideViewControllerDemoTests/Info.plist; 516 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 517 | PRODUCT_NAME = "$(TARGET_NAME)"; 518 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SlideViewControllerDemo.app/SlideViewControllerDemo"; 519 | }; 520 | name = Release; 521 | }; 522 | /* End XCBuildConfiguration section */ 523 | 524 | /* Begin XCConfigurationList section */ 525 | 5BF27D1719F0ADA50095224C /* Build configuration list for PBXProject "SlideViewControllerDemo" */ = { 526 | isa = XCConfigurationList; 527 | buildConfigurations = ( 528 | 5BF27D3D19F0ADA60095224C /* Debug */, 529 | 5BF27D3E19F0ADA60095224C /* Release */, 530 | ); 531 | defaultConfigurationIsVisible = 0; 532 | defaultConfigurationName = Release; 533 | }; 534 | 5BF27D3F19F0ADA60095224C /* Build configuration list for PBXNativeTarget "SlideViewControllerDemo" */ = { 535 | isa = XCConfigurationList; 536 | buildConfigurations = ( 537 | 5BF27D4019F0ADA60095224C /* Debug */, 538 | 5BF27D4119F0ADA60095224C /* Release */, 539 | ); 540 | defaultConfigurationIsVisible = 0; 541 | defaultConfigurationName = Release; 542 | }; 543 | 5BF27D4219F0ADA60095224C /* Build configuration list for PBXNativeTarget "SlideViewControllerDemoTests" */ = { 544 | isa = XCConfigurationList; 545 | buildConfigurations = ( 546 | 5BF27D4319F0ADA60095224C /* Debug */, 547 | 5BF27D4419F0ADA60095224C /* Release */, 548 | ); 549 | defaultConfigurationIsVisible = 0; 550 | defaultConfigurationName = Release; 551 | }; 552 | /* End XCConfigurationList section */ 553 | }; 554 | rootObject = 5BF27D1419F0ADA50095224C /* Project object */; 555 | } 556 | -------------------------------------------------------------------------------- /SlideViewControllerDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SlideViewControllerDemo.xcodeproj/project.xcworkspace/xcuserdata/Dahan_payMore.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Demons-Bee/SlideViewControllerDemo/ac70c53787eb9cb6dbced5ae788b077d8fd49ed8/SlideViewControllerDemo.xcodeproj/project.xcworkspace/xcuserdata/Dahan_payMore.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SlideViewControllerDemo.xcodeproj/xcuserdata/Dahan_payMore.xcuserdatad/xcschemes/SlideViewControllerDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /SlideViewControllerDemo.xcodeproj/xcuserdata/Dahan_payMore.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SlideViewControllerDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 5BF27D1B19F0ADA60095224C 16 | 17 | primary 18 | 19 | 20 | 5BF27D3419F0ADA60095224C 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SlideTest 4 | // 5 | // Created by 胡大函 on 14/10/10. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. 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 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SlideTest 4 | // 5 | // Created by 胡大函 on 14/10/10. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "NavOneController.h" 11 | #import "NavTwoController.h" 12 | #import "NavThreeController.h" 13 | #import "DHTabBarViewController.h" 14 | #import "DHMenuPagerViewController.h" 15 | #import "ViewController.h" 16 | #import "DHSlideMenuController.h" 17 | #import "MenuTableController.h" 18 | @interface AppDelegate () 19 | 20 | @end 21 | 22 | @implementation AppDelegate 23 | 24 | 25 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 26 | _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 27 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; 28 | 29 | ViewController *viewd = [[ViewController alloc] init]; 30 | ViewController *viewd1 = [[ViewController alloc] init]; 31 | ViewController *viewd2 = [[ViewController alloc] init]; 32 | DHMenuPagerViewController *pagerView = [[DHMenuPagerViewController alloc] initWithViewControllers:@[viewd,viewd1,viewd2,viewd1,viewd2,viewd1,viewd2] titles:@[@"page1",@"page2",@"page3",@"page4",@"page5",@"page6",@"page7"] menuBackgroundColor:[UIColor colorWithRed:132%255/255.0 green:142%255/255.0 blue:192%255/255.0 alpha:1] titleColor:[UIColor colorWithRed:1. green:0. blue:0. alpha:0.3] titleColorHighlighted:[UIColor yellowColor]]; 33 | pagerView.title = @"PagerView"; 34 | 35 | NavOneController *one = [[NavOneController alloc] init]; 36 | NavTwoController *two = [[NavTwoController alloc] initWithRootViewController:pagerView]; 37 | NavThreeController *three = [[NavThreeController alloc] init]; 38 | 39 | DHTabBarViewController *rootTab = [[DHTabBarViewController alloc] initWithChildViewControllers:@[two,one,three] tabTitles:@[@"PagerView",@"two",@"three"] tabImages:@[@"tabbar_discover",@"tabbar_discover",@"tabbar_discover"] selectedImages:@[@"tabbar_discover_highlighted",@"tabbar_discover_highlighted",@"tabbar_discover_highlighted"] backgroundImage:@"tab_bg" selectionIndicatorImage:@"tab_bg_pressed"]; 40 | rootTab.tabBar.translucent = NO; 41 | 42 | UIViewController *leftViewController=[[UIViewController alloc]init]; 43 | leftViewController.view.backgroundColor=[UIColor purpleColor]; 44 | 45 | MenuTableController *leftMenuController = [[MenuTableController alloc] init]; 46 | MenuTableController *rightMenuController = [[MenuTableController alloc] init]; 47 | 48 | UIViewController *rightViewController=[[UIViewController alloc]init]; 49 | rightViewController.view.backgroundColor=[UIColor cyanColor]; 50 | 51 | //DHSlideMenuController *mainVC = [[DHSlideMenuController alloc] initWithMainViewController:rootTab leftViewController:leftViewController rightViewController:rightViewController animationBlock:nil]; 52 | 53 | DHSlideMenuController *mainVC = [DHSlideMenuController sharedInstance]; 54 | mainVC.mainViewController = rootTab; 55 | mainVC.leftViewController = leftMenuController; 56 | mainVC.rightViewController = rightMenuController; 57 | 58 | mainVC.animationType = SlideAnimationTypeMove; 59 | mainVC.needPanFromViewBounds = YES; 60 | _window.rootViewController = mainVC; 61 | [_window makeKeyAndVisible]; 62 | return YES; 63 | } 64 | 65 | - (void)applicationWillResignActive:(UIApplication *)application { 66 | // 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. 67 | // 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. 68 | } 69 | 70 | - (void)applicationDidEnterBackground:(UIApplication *)application { 71 | // 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. 72 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 73 | } 74 | 75 | - (void)applicationWillEnterForeground:(UIApplication *)application { 76 | // 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. 77 | } 78 | 79 | - (void)applicationDidBecomeActive:(UIApplication *)application { 80 | // 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. 81 | } 82 | 83 | - (void)applicationWillTerminate:(UIApplication *)application { 84 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 85 | } 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/DHSlideMenuController/DHSlideMenuController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DHSlideMenuController.h 3 | // DHSlideMenuController 4 | // 5 | // Created by 胡大函 on 14/10/11. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^MainViewAnimationBlock) (UIView *mainView, CGRect orginFrame, CGFloat xOffset); 12 | typedef NS_ENUM(NSInteger, SlideAnimationType) { 13 | SlideAnimationTypeScale, 14 | SlideAnimationTypeMove 15 | }; 16 | @interface DHSlideMenuController : UIViewController 17 | 18 | @property (assign, nonatomic) BOOL needSwipeShowMenu; 19 | @property (assign, nonatomic) BOOL needShowBoundsShadow; 20 | @property (assign, nonatomic) BOOL needPanFromViewBounds; 21 | 22 | @property (strong, nonatomic) UIViewController *mainViewController; 23 | @property (strong, nonatomic) UIViewController *leftViewController; 24 | @property (strong, nonatomic) UIViewController *rightViewController; 25 | 26 | @property (assign, nonatomic) CGFloat leftViewShowWidth; 27 | @property (assign, nonatomic) CGFloat rightViewShowWidth; 28 | @property (assign, nonatomic) NSTimeInterval animationDuration; 29 | 30 | @property (copy, nonatomic) MainViewAnimationBlock mainViewAnimationBlock; 31 | @property (assign, nonatomic) SlideAnimationType animationType; 32 | 33 | + (instancetype)sharedInstance; 34 | - (instancetype)initWithMainViewController:(UIViewController *)main leftViewController:(UIViewController *)left rightViewController:(UIViewController *)right animationBlock:(MainViewAnimationBlock)block; 35 | - (void)showLeftViewController:(BOOL)animated; 36 | - (void)showRightViewController:(BOOL)animated; 37 | - (void)hideSlideMenuViewController:(BOOL)animated; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/DHSlideMenuController/DHSlideMenuController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DHSlideMenuController.m 3 | // DHSlideMenuController 4 | // 5 | // Created by 胡大函 on 14/10/11. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import "DHSlideMenuController.h" 10 | 11 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 12 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 13 | 14 | @interface DHSlideMenuController () { 15 | UIView *baseView; 16 | UIView *currentView; 17 | UIPanGestureRecognizer *panGestureRecognizer; 18 | CGPoint startPanPoint; 19 | BOOL panMovingLeftOrRight; 20 | UIButton *coverButton; 21 | BOOL isInited; 22 | } 23 | 24 | @end 25 | static float canTouchAreaWidth = 40; 26 | @implementation DHSlideMenuController 27 | 28 | + (instancetype)sharedInstance { 29 | static DHSlideMenuController *sharedSMC; 30 | static dispatch_once_t onceToken; 31 | dispatch_once(&onceToken, ^{ 32 | sharedSMC = [[self alloc] init]; 33 | }); 34 | return sharedSMC; 35 | } 36 | 37 | - (instancetype)init { 38 | return [self initWithNibName:nil bundle:nil]; 39 | } 40 | 41 | - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 42 | if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { 43 | _leftViewShowWidth=200; 44 | _rightViewShowWidth=200; 45 | _animationDuration = 0.35; 46 | _needShowBoundsShadow = YES; 47 | panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)]; 48 | panGestureRecognizer.delegate = self; 49 | panMovingLeftOrRight = NO; 50 | coverButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; 51 | [coverButton addTarget:self action:@selector(hideSideViewController) forControlEvents:UIControlEventTouchUpInside]; 52 | isInited = YES; 53 | } 54 | return self; 55 | } 56 | 57 | - (instancetype)initWithMainViewController:(UIViewController *)main leftViewController:(UIViewController *)left rightViewController:(UIViewController *)right animationBlock:(MainViewAnimationBlock)block { 58 | if (self = [self init]) { 59 | _mainViewController = main; 60 | _leftViewController = left; 61 | _rightViewController = right; 62 | _mainViewAnimationBlock = block; 63 | } 64 | return self; 65 | } 66 | 67 | - (void)viewDidLoad { 68 | [super viewDidLoad]; 69 | baseView = self.view; 70 | self.needSwipeShowMenu = YES; 71 | } 72 | 73 | - (void)viewWillAppear:(BOOL)animated { 74 | [super viewWillAppear:animated]; 75 | if (!_mainViewController) { 76 | NSAssert(NO, @"You must set mainViewController!!"); 77 | } 78 | if (isInited) { 79 | [self resetCurrentViewToMainViewController]; 80 | isInited = NO; 81 | } 82 | } 83 | 84 | - (void)setMainViewController:(UIViewController *)mainViewController { 85 | if (_mainViewController != mainViewController) { 86 | if (_mainViewController) { 87 | [_mainViewController removeFromParentViewController]; 88 | } 89 | _mainViewController = mainViewController; 90 | if (_mainViewController) { 91 | [self addChildViewController:_mainViewController]; 92 | } 93 | if (!isInited) { 94 | [self resetCurrentViewToMainViewController]; 95 | } 96 | } 97 | 98 | } 99 | 100 | - (void)setLeftViewController:(UIViewController *)leftViewController { 101 | if (_leftViewController != leftViewController) { 102 | if (_leftViewController) { 103 | [_leftViewController removeFromParentViewController]; 104 | } 105 | _leftViewController = leftViewController; 106 | if (_leftViewController) { 107 | [self addChildViewController:_leftViewController]; 108 | } 109 | } 110 | } 111 | 112 | - (void)setRightViewController:(UIViewController *)rightViewController { 113 | if (_rightViewController != rightViewController) { 114 | if (_rightViewController) { 115 | [_rightViewController removeFromParentViewController]; 116 | } 117 | _rightViewController = rightViewController; 118 | if (_rightViewController) { 119 | [self addChildViewController:_rightViewController]; 120 | } 121 | } 122 | } 123 | 124 | - (void)setNeedSwipeShowMenu:(BOOL)needSwipeShowMenu { 125 | _needSwipeShowMenu = needSwipeShowMenu; 126 | if (needSwipeShowMenu) { 127 | [baseView addGestureRecognizer:panGestureRecognizer]; 128 | } else { 129 | [baseView removeGestureRecognizer:panGestureRecognizer]; 130 | } 131 | } 132 | 133 | - (void)resetCurrentViewToMainViewController { 134 | if (currentView != _mainViewController.view) { 135 | CGRect frame = CGRectZero; 136 | CGAffineTransform transform = CGAffineTransformIdentity; 137 | if (!currentView) { 138 | frame = baseView.bounds; 139 | } else { 140 | frame = currentView.frame; 141 | transform = currentView.transform; 142 | } 143 | [currentView removeFromSuperview]; 144 | currentView = _mainViewController.view; 145 | [baseView addSubview:currentView]; 146 | currentView.transform = transform; 147 | currentView.frame = frame; 148 | if (_leftViewController.view.superview || _rightViewController.view.superview) { 149 | [currentView addSubview:coverButton]; 150 | [self showShadow:_needShowBoundsShadow]; 151 | } 152 | } 153 | } 154 | 155 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { 156 | if (gestureRecognizer == panGestureRecognizer) { 157 | //控制是否从视图的边缘触发弹出侧边试图 158 | if (_needPanFromViewBounds && [gestureRecognizer locationInView:currentView].x >= canTouchAreaWidth && [gestureRecognizer locationInView:currentView].x < currentView.frame.size.width - canTouchAreaWidth) { 159 | return NO; 160 | } 161 | UIPanGestureRecognizer *panGesture = (UIPanGestureRecognizer *)gestureRecognizer; 162 | CGPoint translation = [panGesture translationInView:baseView]; 163 | if ([panGesture velocityInView:baseView].x < 600 && ABS(translation.x) / ABS(translation.y) > 1) { 164 | return YES; 165 | } 166 | return NO; 167 | } 168 | return YES; 169 | } 170 | 171 | //拦截下级视图的手势 172 | -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { 173 | return YES; 174 | } 175 | 176 | //手势会传递到下级视图 177 | //- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { 178 | // return YES; 179 | //} 180 | 181 | //手势派发给下级视图 182 | //- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRequireFailureOfGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { 183 | // return YES; 184 | //} 185 | 186 | - (void)pan:(UIPanGestureRecognizer *)pan { 187 | if (panGestureRecognizer.state == UIGestureRecognizerStateBegan) { 188 | startPanPoint = currentView.frame.origin; 189 | if (currentView.frame.origin.x == 0) { 190 | [self showShadow:_needShowBoundsShadow]; 191 | } 192 | CGPoint velocity = [pan velocityInView:baseView]; 193 | if (velocity.x > 0) { 194 | if (currentView.frame.origin.x >= 0 && _leftViewController && !_leftViewController.view.superview) { 195 | [self willShowLeftViewController]; 196 | } 197 | } else if (velocity.x < 0) { 198 | if (currentView.frame.origin.x <= 0 && _rightViewController && !_rightViewController.view.superview) { 199 | [self willShowRightViewController]; 200 | } 201 | } 202 | return; 203 | } 204 | CGPoint currentPostion = [pan translationInView:baseView]; 205 | CGFloat xOffset = startPanPoint.x + currentPostion.x; 206 | if (xOffset > 0) { 207 | if (_leftViewController && _leftViewController.view.superview) { 208 | xOffset = xOffset > _leftViewShowWidth ? _leftViewShowWidth : xOffset; 209 | } else { 210 | xOffset = 0; 211 | } 212 | } else if (xOffset < 0) { 213 | if (_rightViewController && _rightViewController.view.superview) { 214 | xOffset = xOffset < -_rightViewShowWidth ? -_rightViewShowWidth : xOffset; 215 | } else { 216 | xOffset = 0; 217 | } 218 | } 219 | if (xOffset != currentView.frame.origin.x) { 220 | [self layoutCurrentViewWithOffset:xOffset]; 221 | } 222 | if (panGestureRecognizer.state == UIGestureRecognizerStateEnded) { 223 | if (currentView.frame.origin.x == 0) { 224 | [self showShadow:NO]; 225 | } else { 226 | if (panMovingLeftOrRight && currentView.frame.origin.x > 20) { 227 | [self showLeftViewController:YES]; 228 | } else if (!panMovingLeftOrRight && currentView.frame.origin.x < -20) { 229 | [self showRightViewController:YES]; 230 | } else { 231 | [self hideSlideMenuViewController:YES]; 232 | } 233 | } 234 | } else { 235 | CGPoint velocity = [pan velocityInView:baseView]; 236 | if (velocity.x > 0) { 237 | panMovingLeftOrRight = YES; 238 | } else if (velocity.x < 0) { 239 | panMovingLeftOrRight = NO; 240 | } 241 | } 242 | } 243 | 244 | //重写此方法可以自定义mainViewController的出入动画 245 | - (void)layoutCurrentViewWithOffset:(CGFloat)xOffset { 246 | CGFloat totalWidth = baseView.frame.size.width; 247 | CGFloat totalHeight = baseView.frame.size.height; 248 | if (_needShowBoundsShadow) { 249 | currentView.layer.shadowPath = [UIBezierPath bezierPathWithRect:currentView.bounds].CGPath; 250 | } 251 | if (_mainViewAnimationBlock) { 252 | //如果有自定义的动画,则执行自定义动画 253 | _mainViewAnimationBlock(currentView, baseView.bounds, xOffset); 254 | return; 255 | } 256 | if (_animationType == SlideAnimationTypeMove) { 257 | currentView.frame=CGRectMake(xOffset, baseView.bounds.origin.y, totalWidth, totalHeight); 258 | } else { 259 | CGFloat scale = ABS(totalHeight - ABS(xOffset)) / totalHeight; 260 | scale = MAX(0.8, scale); 261 | currentView.transform = CGAffineTransformMakeScale(scale, scale); 262 | if (xOffset > 0) {//右滑 263 | currentView.frame = CGRectMake(xOffset, baseView.bounds.origin.y + (totalHeight * (1 - scale) / 2), totalWidth * scale, totalHeight * scale); 264 | } else {//左滑 265 | currentView.frame = CGRectMake(baseView.frame.size.width * (1 - scale) + xOffset, baseView.bounds.origin.y + (totalHeight * (1 - scale) / 2), totalWidth * scale, totalHeight * scale); 266 | } 267 | } 268 | } 269 | 270 | - (void)willShowLeftViewController { 271 | if (!_leftViewController || _leftViewController.view.superview) { 272 | return; 273 | } 274 | _leftViewController.view.frame = CGRectMake(0, 0, _leftViewShowWidth, baseView.bounds.size.height); 275 | [baseView insertSubview:_leftViewController.view belowSubview:currentView]; 276 | if (_rightViewController && _rightViewController.view.superview) { 277 | [_rightViewController.view removeFromSuperview]; 278 | } 279 | } 280 | 281 | - (void)willShowRightViewController { 282 | if (!_rightViewController || _rightViewController.view.superview) { 283 | return; 284 | } 285 | _rightViewController.view.frame = CGRectMake(baseView.bounds.size.width - _rightViewShowWidth, 0, _rightViewShowWidth, baseView.bounds.size.height); 286 | [baseView insertSubview:_rightViewController.view belowSubview:currentView]; 287 | if (_leftViewController && _leftViewController.view.superview) { 288 | [_leftViewController.view removeFromSuperview]; 289 | } 290 | } 291 | 292 | - (void)showShadow:(BOOL)show { 293 | currentView.layer.shadowOpacity = show ? 0.8f : 0.0f; 294 | if (show) { 295 | currentView.layer.cornerRadius = 4.0f; 296 | currentView.layer.shadowOffset = CGSizeZero; 297 | currentView.layer.shadowRadius = 4.0f; 298 | currentView.layer.shadowPath = [UIBezierPath bezierPathWithRect:currentView.bounds].CGPath; 299 | } 300 | } 301 | 302 | - (void)showLeftViewController:(BOOL)animated { 303 | if (!_leftViewController) { 304 | return; 305 | } 306 | [self willShowLeftViewController]; 307 | NSTimeInterval animatedTime = 0; 308 | if (animated) { 309 | animatedTime = ABS(_leftViewShowWidth - currentView.frame.origin.x) / _leftViewShowWidth * _animationDuration; 310 | } 311 | [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 312 | [UIView animateWithDuration:animatedTime animations:^{ 313 | [self layoutCurrentViewWithOffset:_leftViewShowWidth]; 314 | [currentView addSubview:coverButton]; 315 | [self showShadow:_needShowBoundsShadow]; 316 | }]; 317 | canTouchAreaWidth = currentView.frame.size.width - _leftViewShowWidth; 318 | } 319 | 320 | - (void)showRightViewController:(BOOL)animated { 321 | if (!_rightViewController) { 322 | return; 323 | } 324 | [self willShowRightViewController]; 325 | NSTimeInterval animatedTime = 0; 326 | if (animated) { 327 | animatedTime = ABS(_rightViewShowWidth - currentView.frame.origin.x) / _rightViewShowWidth * _animationDuration; 328 | } 329 | [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 330 | [UIView animateWithDuration:animatedTime animations:^{ 331 | [self layoutCurrentViewWithOffset:-_rightViewShowWidth]; 332 | [currentView addSubview:coverButton]; 333 | [self showShadow:_needShowBoundsShadow]; 334 | }]; 335 | canTouchAreaWidth = currentView.frame.size.width - _rightViewShowWidth; 336 | } 337 | 338 | - (void)hideSlideMenuViewController:(BOOL)animated { 339 | _needPanFromViewBounds = YES; 340 | [self showShadow:NO]; 341 | NSTimeInterval animatedTime = 0; 342 | if (animated) { 343 | animatedTime = ABS(currentView.frame.origin.x / (currentView.frame.origin.x > 0 ? _leftViewShowWidth:_rightViewShowWidth)) * _animationDuration; 344 | } 345 | [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 346 | [UIView animateWithDuration:animatedTime animations:^{ 347 | [self layoutCurrentViewWithOffset:0]; 348 | } completion:^(BOOL finished) { 349 | [coverButton removeFromSuperview]; 350 | [_leftViewController.view removeFromSuperview]; 351 | [_rightViewController.view removeFromSuperview]; 352 | }]; 353 | canTouchAreaWidth = 40; 354 | } 355 | 356 | - (void)hideSideViewController { 357 | [self hideSlideMenuViewController:YES]; 358 | } 359 | 360 | @end 361 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/DHTabBarPagerView/DHMenuViewPagerView/DHLandscapeMenuScrollView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DHLandscapeMenuScrollView.h 3 | // DHMenuViewPager 4 | // 5 | // Created by 胡大函 on 14/9/30. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol MenuViewDelegate 12 | 13 | - (void)menuSelectedBtnIndex:(NSUInteger)tag; 14 | - (void)contentViewChangedIndex:(NSUInteger)tag; 15 | - (void)contentViewChangedAtIndex:(NSUInteger)tag offset:(CGPoint)offset; 16 | 17 | @end 18 | 19 | @interface DHLandscapeMenuScrollView : UIScrollView 20 | 21 | @property (assign, nonatomic) id clickDelegate; 22 | 23 | - (id)initWithFrame:(CGRect)frame Titles:(NSArray *)titles shouldShowIndicatorView:(BOOL)shouldShowIndicatorView; 24 | - (id)initWithFrame:(CGRect)frame Titles:(NSArray *)titles shouldShowIndicatorView:(BOOL)shouldShowIndicatorView menuBackgroundColor:(UIColor *)backColor titleColor:(UIColor *)normalColor titleColorHighlighted:(UIColor *)highlightedColor; 25 | - (void)selectBtnWithTag:(NSUInteger)tag; 26 | - (void)changeIndicatorViewWithPage:(CGFloat)page offset:(CGFloat)x; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/DHTabBarPagerView/DHMenuViewPagerView/DHLandscapeMenuScrollView.m: -------------------------------------------------------------------------------- 1 | // 2 | // DHLandscapeMenuScrollView.m 3 | // DHMenuViewPager 4 | // 5 | // Created by 胡大函 on 14/9/30. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import "DHLandscapeMenuScrollView.h" 10 | #define kButtonHeight 30 11 | #define kIndicatorViewHeight 2 12 | #define kButtonTagStarted 100 13 | static float kMarginWidth = 15; 14 | @implementation DHLandscapeMenuScrollView { 15 | UIView *indicatorView; 16 | } 17 | 18 | - (id)initWithFrame:(CGRect)frame Titles:(NSArray *)titles shouldShowIndicatorView:(BOOL)shouldShowIndicatorView { 19 | return [self initWithFrame:frame Titles:titles shouldShowIndicatorView:shouldShowIndicatorView menuBackgroundColor:nil titleColor:nil titleColorHighlighted:nil]; 20 | } 21 | 22 | - (id)initWithFrame:(CGRect)frame Titles:(NSArray *)titles shouldShowIndicatorView:(BOOL)shouldShowIndicatorView menuBackgroundColor:(UIColor *)backColor titleColor:(UIColor *)normalColor titleColorHighlighted:(UIColor *)highlightedColor { 23 | int x = kMarginWidth; 24 | if (self = [super initWithFrame:frame]) { 25 | self.backgroundColor = backColor ? backColor : [UIColor whiteColor]; 26 | self.showsHorizontalScrollIndicator = NO; 27 | self.bounces = NO; 28 | for (int i = 0; i < titles.count; ++i) { 29 | UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; 30 | [btn setFrame:CGRectMake(x, 0, 0, kButtonHeight)]; 31 | [btn setTitle:titles[i] forState:UIControlStateNormal]; 32 | [btn setTitleColor:normalColor ? normalColor : [UIColor lightGrayColor] forState:UIControlStateNormal]; 33 | [btn setTitleColor:highlightedColor ? highlightedColor : [UIColor blueColor] forState:UIControlStateSelected]; 34 | btn.tag = kButtonTagStarted + i; 35 | [btn addTarget:self action:@selector(clickBtn:) forControlEvents:UIControlEventTouchUpInside]; 36 | [btn sizeToFit]; 37 | [self addSubview:btn]; 38 | x += btn.frame.size.width + kMarginWidth; 39 | if (i == 0) { 40 | [btn setSelected:YES]; 41 | } 42 | } 43 | if (x <= self.frame.size.width) { 44 | [[self subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)]; 45 | x = 0; 46 | for (int i = 0; i < titles.count; ++i) { 47 | UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; 48 | [btn setFrame:CGRectMake(x, 0, self.frame.size.width/titles.count, kButtonHeight)]; 49 | [btn setTitle:titles[i] forState:UIControlStateNormal]; 50 | [btn setTitleColor:normalColor ? normalColor : [UIColor lightGrayColor] forState:UIControlStateNormal]; 51 | [btn setTitleColor:highlightedColor ? highlightedColor : [UIColor blueColor] forState:UIControlStateSelected]; 52 | btn.tag = kButtonTagStarted + i; 53 | [btn addTarget:self action:@selector(clickBtn:) forControlEvents:UIControlEventTouchUpInside]; 54 | [self addSubview:btn]; 55 | x += btn.frame.size.width; 56 | if (i == 0) { 57 | [btn setSelected:YES]; 58 | } 59 | } 60 | } 61 | if (shouldShowIndicatorView) { 62 | indicatorView = [[UIView alloc] initWithFrame:CGRectMake([self viewWithTag:kButtonTagStarted + 0].frame.origin.x, self.frame.size.height - kIndicatorViewHeight, [self viewWithTag:kButtonTagStarted + 0].frame.size.width, kIndicatorViewHeight)]; 63 | [indicatorView setBackgroundColor:[UIColor redColor]]; 64 | [self addSubview:indicatorView]; 65 | } 66 | self.contentSize = CGSizeMake(x, self.frame.size.height); 67 | self.scrollsToTop = NO; 68 | } 69 | return self; 70 | } 71 | 72 | - (void)changeIndicatorViewWithPage:(CGFloat)page offset:(CGFloat)x { 73 | UIButton *button = (UIButton *)[self viewWithTag:page + kButtonTagStarted]; 74 | indicatorView.frame = CGRectMake(button.frame.origin.x, indicatorView.frame.origin.y, button.frame.size.width, indicatorView.frame.size.height); 75 | } 76 | 77 | - (void)selectBtnWithTag:(NSUInteger)tag { 78 | UIButton *button = (UIButton *)[self viewWithTag:tag + kButtonTagStarted]; 79 | [button setSelected:YES]; 80 | [UIView animateWithDuration:0.3 animations:^{ 81 | CGRect rc = CGRectMake(button.frame.origin.x - 20, button.frame.origin.y, button.frame.size.width + 100, button.frame.size.height); 82 | [self scrollRectToVisible:rc animated:NO]; 83 | for (UIButton *btn in self.subviews) { 84 | if (![btn isEqual:button]) { 85 | if ([btn respondsToSelector:@selector(setSelected:)]) { 86 | [btn setSelected:NO]; 87 | } 88 | } 89 | } 90 | }]; 91 | } 92 | 93 | - (void)clickBtn:(UIButton *)sender { 94 | [sender setSelected:YES]; 95 | [UIView animateWithDuration:0.3 animations:^{ 96 | [indicatorView setFrame:CGRectMake(sender.frame.origin.x, indicatorView.frame.origin.y, sender.frame.size.width, indicatorView.frame.size.height)]; 97 | CGRect rc = CGRectMake(sender.frame.origin.x - 20, sender.frame.origin.y, sender.frame.size.width + 100, sender.frame.size.height); 98 | [self scrollRectToVisible:rc animated:NO]; 99 | for (UIButton *btn in self.subviews) { 100 | if (![btn isEqual:sender]) { 101 | if ([btn respondsToSelector:@selector(setSelected:)]) { 102 | [btn setSelected:NO]; 103 | } 104 | } 105 | } 106 | if (_clickDelegate) { 107 | [_clickDelegate menuSelectedBtnIndex:sender.tag - kButtonTagStarted]; 108 | } 109 | }]; 110 | } 111 | 112 | - (BOOL)touchesShouldCancelInContentView:(UIView *)view { 113 | return YES; 114 | } 115 | 116 | @end 117 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/DHTabBarPagerView/DHMenuViewPagerView/DHLandscapeTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DHLandscapeTableView.h 3 | // DHMenuViewPager 4 | // 5 | // Created by 胡大函 on 14/9/29. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DHLandscapeMenuScrollView.h" 11 | @interface DHLandscapeTableView : UIView 12 | 13 | @property (strong, nonatomic) UITableView *tableView; 14 | @property (strong, nonatomic) NSArray *sourceArray; 15 | @property (assign, nonatomic) id swipDelegate; 16 | 17 | - (id)initWithFrame:(CGRect)frame viewArray:(NSArray *)views; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/DHTabBarPagerView/DHMenuViewPagerView/DHLandscapeTableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // DHLandscapeTableView.m 3 | // DHMenuViewPager 4 | // 5 | // Created by 胡大函 on 14/9/29. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import "DHLandscapeTableView.h" 10 | #define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1] 11 | @implementation DHLandscapeTableView 12 | 13 | - (id)initWithFrame:(CGRect)frame viewArray:(NSArray *)views { 14 | if (self = [super initWithFrame:frame]) { 15 | //self.backgroundColor = [UIColor redColor]; 16 | _tableView = [[UITableView alloc]initWithFrame:self.bounds]; 17 | _tableView.delegate = self; 18 | _tableView.dataSource = self; 19 | _tableView.scrollsToTop = NO; 20 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 21 | _tableView.transform = CGAffineTransformMakeRotation(-M_PI/2); 22 | _tableView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height); 23 | _tableView.showsVerticalScrollIndicator = NO; 24 | _tableView.pagingEnabled = YES; 25 | _tableView.backgroundColor = [UIColor whiteColor]; 26 | _tableView.bounces =NO; 27 | [self addSubview:_tableView]; 28 | _sourceArray = views; 29 | } 30 | return self; 31 | } 32 | 33 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 34 | return self.frame.size.width; 35 | } 36 | 37 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 38 | return _sourceArray.count; 39 | } 40 | 41 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 42 | static NSString *reuseIdentifier = @"ViewCell"; 43 | UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]; 44 | cell.contentView.backgroundColor=[UIColor clearColor]; 45 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 46 | cell.transform = CGAffineTransformMakeRotation(M_PI/2); 47 | UIViewController *vc = [_sourceArray objectAtIndex:[indexPath row]]; 48 | vc.view.frame = cell.bounds; 49 | [cell.contentView addSubview:vc.view]; 50 | return cell; 51 | } 52 | 53 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { 54 | if (_swipDelegate) { 55 | [_swipDelegate contentViewChangedIndex:[(_tableView.indexPathsForVisibleRows[0]) row]]; 56 | } 57 | } 58 | 59 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 60 | if (_swipDelegate) { 61 | [_swipDelegate contentViewChangedAtIndex:[(_tableView.indexPathsForVisibleRows[0]) row] offset:scrollView.contentOffset]; 62 | } 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/DHTabBarPagerView/DHMenuViewPagerView/DHMenuPagerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DHMenuPagerViewController.h 3 | // DHMenuViewPager 4 | // 5 | // Created by 胡大函 on 14/9/30. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol DHMenuPagerViewDelegate 12 | 13 | - (void)changedTitle:(NSString *)title; 14 | 15 | @end 16 | 17 | @interface DHMenuPagerViewController : UIViewController 18 | 19 | @property (assign, nonatomic) id delegate; 20 | 21 | - (id)initWithViewControllers:(NSArray *)controllers; 22 | 23 | - (id)initWithViewControllers:(NSArray *)controllers titles:(NSArray *)titles; 24 | 25 | - (id)initWithViewControllers:(NSArray *)controllers titles:(NSArray *)titles menuBackgroundColor:(UIColor *)backColor titleColor:(UIColor *)normalColor titleColorHighlighted:(UIColor *)highlightedColor; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/DHTabBarPagerView/DHMenuViewPagerView/DHMenuPagerViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DHMenuPagerViewController.m 3 | // DHMenuViewPager 4 | // 5 | // Created by 胡大函 on 14/9/30. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import "DHMenuPagerViewController.h" 10 | #import "DHLandscapeTableView.h" 11 | #import "DHLandscapeMenuScrollView.h" 12 | #define kTopBarHeight 0 13 | #define kMenuViewHeight 30 14 | @interface DHMenuPagerViewController () { 15 | NSArray *titleArray; 16 | DHLandscapeMenuScrollView *menuView; 17 | DHLandscapeTableView *contentView; 18 | } 19 | 20 | @end 21 | 22 | @implementation DHMenuPagerViewController 23 | 24 | - (id)initWithViewControllers:(NSArray *)controllers { 25 | return [self initWithViewControllers:controllers titles:nil]; 26 | } 27 | 28 | - (id)initWithViewControllers:(NSArray *)controllers titles:(NSArray *)titles { 29 | return [self initWithViewControllers:controllers titles:titles menuBackgroundColor:nil titleColor:nil titleColorHighlighted:nil]; 30 | } 31 | 32 | - (id)initWithViewControllers:(NSArray *)controllers titles:(NSArray *)titles menuBackgroundColor:(UIColor *)backColor titleColor:(UIColor *)normalColor titleColorHighlighted:(UIColor *)highlightedColor { 33 | self = [super init]; 34 | if (self) { 35 | self.automaticallyAdjustsScrollViewInsets = NO; 36 | if (titles) { 37 | titleArray = titles; 38 | menuView = [[DHLandscapeMenuScrollView alloc] initWithFrame:CGRectMake(0, kTopBarHeight, self.view.frame.size.width, kMenuViewHeight) Titles:titles shouldShowIndicatorView:NO menuBackgroundColor:backColor titleColor:normalColor titleColorHighlighted:highlightedColor]; 39 | menuView.clickDelegate = self; 40 | [self.view addSubview:menuView]; 41 | contentView = [[DHLandscapeTableView alloc] initWithFrame:CGRectMake(0, kTopBarHeight + kMenuViewHeight, self.view.frame.size.width, self.view.frame.size.height - kTopBarHeight - kMenuViewHeight) viewArray:controllers]; 42 | [self.view addSubview:contentView]; 43 | } else { 44 | contentView = [[DHLandscapeTableView alloc] initWithFrame:CGRectMake(0, kTopBarHeight, self.view.frame.size.width, self.view.frame.size.height - kTopBarHeight) viewArray:controllers]; 45 | [self.view addSubview:contentView]; 46 | } 47 | contentView.swipDelegate = self; 48 | } 49 | return self; 50 | } 51 | 52 | - (void)menuSelectedBtnIndex:(NSUInteger)tag { 53 | [contentView.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:tag inSection:0] atScrollPosition:UITableViewScrollPositionNone animated:YES]; 54 | } 55 | 56 | - (void)contentViewChangedIndex:(NSUInteger)tag { 57 | if (_delegate) { 58 | [_delegate changedTitle:titleArray[tag]]; 59 | } 60 | [menuView selectBtnWithTag:tag]; 61 | } 62 | 63 | - (void)contentViewChangedAtIndex:(NSUInteger)tag offset:(CGPoint)offset { 64 | [menuView changeIndicatorViewWithPage:tag offset:offset.y]; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/DHTabBarPagerView/DHTabBarViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DHTabBarViewController.h 3 | // DHTabBarMenuViewPager 4 | // 5 | // Created by 胡大函 on 14/10/8. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DHTabBarViewController : UITabBarController 12 | 13 | @property (strong, nonatomic) NSArray *tabBarImages; 14 | 15 | - (id)initWithChildViewControllers:(NSArray *)controllers tabTitles:(NSArray *)titles tabImages:(NSArray *)images selectedImages:(NSArray *)selectedImages backgroundImage:(NSString *)backgroundImage selectionIndicatorImage:(NSString *)selectionIndicatorImage; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/DHTabBarPagerView/DHTabBarViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DHTabBarViewController.m 3 | // DHTabBarMenuViewPager 4 | // 5 | // Created by 胡大函 on 14/10/8. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import "DHTabBarViewController.h" 10 | #import "DHMenuPagerViewController.h" 11 | #import "ViewController.h" 12 | 13 | @interface DHTabBarViewController () { 14 | NSArray *_titles; 15 | NSArray *_images; 16 | NSArray *_selectedImages; 17 | UIImage *_backgroundImage; 18 | UIImage *_selectionIndicatorImage; 19 | } 20 | 21 | @end 22 | 23 | @implementation DHTabBarViewController 24 | 25 | - (id)initWithChildViewControllers:(NSArray *)controllers tabTitles:(NSArray *)titles tabImages:(NSArray *)images selectedImages:(NSArray *)selectedImages backgroundImage:(NSString *)backgroundImage selectionIndicatorImage:(NSString *)selectionIndicatorImage { 26 | if (self = [super init]) { 27 | for (int i = 0; i < controllers.count; ++i) { 28 | [self addChildViewController:controllers[i]]; 29 | _titles = titles; 30 | _images = images; 31 | _selectedImages = selectedImages; 32 | _backgroundImage = [self imageNamedWithDefaultRenderingMode:backgroundImage]; 33 | _selectionIndicatorImage = [self imageNamedWithDefaultRenderingMode:selectionIndicatorImage]; 34 | } 35 | self.title = titles[0]; 36 | } 37 | return self; 38 | } 39 | 40 | - (void)viewDidAppear:(BOOL)animated { 41 | [super viewDidAppear:animated]; 42 | self.tabBar.backgroundImage = _backgroundImage; 43 | self.tabBar.selectionIndicatorImage = _selectionIndicatorImage; 44 | for (int i = 0; i < self.tabBar.items.count; i++) { 45 | UITabBarItem *item = self.tabBar.items[i]; 46 | item.titlePositionAdjustment = UIOffsetMake(0, -3); 47 | item.title = _titles[i]; 48 | item.image = [self imageNamedWithDefaultRenderingMode:_images[i]]; 49 | item.selectedImage = [self imageNamedWithDefaultRenderingMode:_selectedImages[i]]; 50 | [item setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor orangeColor], NSForegroundColorAttributeName, nil] forState:UIControlStateSelected]; 51 | [item setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor colorWithRed:0x3c / 255.0 green:0x80 / 255.0 blue:0x1a / 255.0 alpha:1.0], NSBackgroundColorAttributeName, nil] forState:UIControlStateNormal]; 52 | } 53 | } 54 | 55 | - (UIImage *)imageNamedWithDefaultRenderingMode:(NSString *)imageName { 56 | UIImage *image = [[UIImage imageNamed:imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 57 | return image; 58 | } 59 | 60 | - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item { 61 | 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/DHTabBarPagerView/ParentCellViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ParentCellViewController.h 3 | // DHTabBarMenuViewPager 4 | // 5 | // Created by 胡大函 on 14/10/8. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ParentCellViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/DHTabBarPagerView/ParentCellViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ParentCellViewController.m 3 | // DHTabBarMenuViewPager 4 | // 5 | // Created by 胡大函 on 14/10/8. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import "ParentCellViewController.h" 10 | 11 | @interface ParentCellViewController () 12 | 13 | @end 14 | 15 | @implementation ParentCellViewController 16 | 17 | - (void)loadView { 18 | [super loadView]; 19 | self.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 64 - 49 - 30); 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /SlideViewControllerDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | cn.com.misol.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/MenuTableController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuTableController.h 3 | // SlideViewControllerDemo 4 | // 5 | // Created by Dahan Hu on 1/29/16. 6 | // Copyright © 2016 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MenuTableController : UITableViewController 12 | 13 | @property (strong,nonatomic) NSArray *titles; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/MenuTableController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MenuTableController.m 3 | // SlideViewControllerDemo 4 | // 5 | // Created by Dahan Hu on 1/29/16. 6 | // Copyright © 2016 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import "MenuTableController.h" 10 | 11 | @interface MenuTableController () 12 | 13 | @end 14 | 15 | @implementation MenuTableController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.titles = @[@"菜单项1",@"菜单项2",@"菜单项3",@"菜单项4",@"菜单项5"]; 20 | } 21 | 22 | #pragma mark - Table view data source 23 | 24 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 25 | return 5; 26 | } 27 | 28 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 29 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; 30 | if (!cell) { 31 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; 32 | } 33 | cell.textLabel.text = self.titles[indexPath.row]; 34 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 35 | 36 | return cell; 37 | } 38 | 39 | /* 40 | // Override to support conditional editing of the table view. 41 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { 42 | // Return NO if you do not want the specified item to be editable. 43 | return YES; 44 | } 45 | */ 46 | 47 | /* 48 | // Override to support editing the table view. 49 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { 50 | if (editingStyle == UITableViewCellEditingStyleDelete) { 51 | // Delete the row from the data source 52 | [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; 53 | } else if (editingStyle == UITableViewCellEditingStyleInsert) { 54 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view 55 | } 56 | } 57 | */ 58 | 59 | /* 60 | // Override to support rearranging the table view. 61 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { 62 | } 63 | */ 64 | 65 | /* 66 | // Override to support conditional rearranging of the table view. 67 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { 68 | // Return NO if you do not want the item to be re-orderable. 69 | return YES; 70 | } 71 | */ 72 | 73 | /* 74 | #pragma mark - Navigation 75 | 76 | // In a storyboard-based application, you will often want to do a little preparation before navigation 77 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 78 | // Get the new view controller using [segue destinationViewController]. 79 | // Pass the selected object to the new view controller. 80 | } 81 | */ 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/NavOneController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NavOneController.h 3 | // SlideTest 4 | // 5 | // Created by 胡大函 on 14/10/10. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NavParentController.h" 11 | @interface NavOneController : NavParentController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/NavOneController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NavOneController.m 3 | // SlideTest 4 | // 5 | // Created by 胡大函 on 14/10/10. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import "NavOneController.h" 10 | #import "DHSlideMenuController.h" 11 | @interface NavOneController () 12 | 13 | @end 14 | 15 | @implementation NavOneController 16 | 17 | - (void)loadView { 18 | [super loadView]; 19 | UIViewController *root = [[UIViewController alloc] init]; 20 | root.view.backgroundColor = [UIColor brownColor]; 21 | root.title = @"SingleView"; 22 | UILabel *lable1 = [[UILabel alloc] initWithFrame:CGRectMake(30, 242, self.view.frame.size.width - 60, 100)]; 23 | lable1.text = @"Lable"; 24 | lable1.textColor = [UIColor whiteColor]; 25 | lable1.font = [UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:50]; 26 | lable1.textAlignment = NSTextAlignmentCenter; 27 | lable1.backgroundColor = [UIColor colorWithWhite:0.6 alpha:0.7]; 28 | [root.view addSubview:lable1]; 29 | [self addChildViewController:root]; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/NavParentController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NavParentController.h 3 | // SlideTest 4 | // 5 | // Created by 胡大函 on 14/10/11. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NavParentController : UINavigationController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/NavParentController.m: -------------------------------------------------------------------------------- 1 | 2 | 3 | // 4 | // NavParentController.m 5 | // SlideTest 6 | // 7 | // Created by 胡大函 on 14/10/11. 8 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 9 | // 10 | 11 | #import "NavParentController.h" 12 | #import "DHSlideMenuController.h" 13 | @interface NavParentController () 14 | 15 | @end 16 | 17 | @implementation NavParentController 18 | 19 | - (void)loadView { 20 | [super loadView]; 21 | self.navigationBar.translucent = NO; 22 | //self.navigationBar.barTintColor = [UIColor colorWithRed:132%255/255.0 green:142%255/255.0 blue:192%255/255.0 alpha:0.8]; 23 | self.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor cyanColor],NSForegroundColorAttributeName, [UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:30],NSFontAttributeName, nil]; 24 | [self.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav_bg"] forBarMetrics:UIBarMetricsDefault]; 25 | } 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | 30 | } 31 | 32 | - (void)viewDidAppear:(BOOL)animated { 33 | for (UIViewController *vc in self.childViewControllers) { 34 | vc.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ToggleMenu"] style:UIBarButtonItemStylePlain target:self action:@selector(toggleSideView)]; 35 | vc.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor]; 36 | } 37 | [super viewDidAppear:animated]; 38 | } 39 | 40 | - (void)toggleSideView { 41 | [[DHSlideMenuController sharedInstance] showLeftViewController:YES]; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/NavThreeController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NavThreeController.h 3 | // SlideTest 4 | // 5 | // Created by 胡大函 on 14/10/10. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NavParentController.h" 11 | @interface NavThreeController : NavParentController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/NavThreeController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NavThreeController.m 3 | // SlideTest 4 | // 5 | // Created by 胡大函 on 14/10/10. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import "NavThreeController.h" 10 | 11 | @interface NavThreeController () 12 | 13 | @end 14 | 15 | @implementation NavThreeController 16 | 17 | - (void)loadView { 18 | [super loadView]; 19 | UIViewController *root = [[UIViewController alloc] init]; 20 | root.view.backgroundColor = [UIColor lightGrayColor]; 21 | root.title = @"ThirdView"; 22 | UILabel *lable1 = [[UILabel alloc] initWithFrame:CGRectMake(30, 242, self.view.frame.size.width - 60, 100)]; 23 | lable1.text = @"Lable"; 24 | lable1.textColor = [UIColor whiteColor]; 25 | lable1.font = [UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:50]; 26 | lable1.textAlignment = NSTextAlignmentCenter; 27 | lable1.backgroundColor = [UIColor colorWithWhite:0.6 alpha:0.7]; 28 | [root.view addSubview:lable1]; 29 | [self addChildViewController:root]; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/NavTwoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NavTwoController.h 3 | // SlideTest 4 | // 5 | // Created by 胡大函 on 14/10/10. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NavParentController.h" 11 | @interface NavTwoController : NavParentController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/NavTwoController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NavTwoController.m 3 | // SlideTest 4 | // 5 | // Created by 胡大函 on 14/10/10. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import "NavTwoController.h" 10 | 11 | @interface NavTwoController () 12 | 13 | @end 14 | 15 | @implementation NavTwoController 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/ToggleMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Demons-Bee/SlideViewControllerDemo/ac70c53787eb9cb6dbced5ae788b077d8fd49ed8/SlideViewControllerDemo/ToggleMenu.png -------------------------------------------------------------------------------- /SlideViewControllerDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // SlideTest 4 | // 5 | // Created by 胡大函 on 14/10/10. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ParentCellViewController.h" 11 | @interface ViewController : ParentCellViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // SlideTest 4 | // 5 | // Created by 胡大函 on 14/10/10. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "DHMenuPagerViewController.h" 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | float a = rand() % 255 / 255.0; 20 | self.view.backgroundColor = [UIColor colorWithRed:132%255/255.0 green:142%255/255.0 blue:192%255/255.0 alpha:a]; 21 | UILabel *lable1 = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width - 60, 100)]; 22 | lable1.text = @"Lable"; 23 | lable1.center = self.view.center; 24 | lable1.textColor = [UIColor whiteColor]; 25 | lable1.font = [UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:50]; 26 | lable1.textAlignment = NSTextAlignmentCenter; 27 | lable1.backgroundColor = [UIColor colorWithWhite:0.6 alpha:0.7]; 28 | [self.view addSubview:lable1]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SlideViewControllerDemo 4 | // 5 | // Created by 胡大函 on 14/10/17. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. 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 | -------------------------------------------------------------------------------- /SlideViewControllerDemo/nav_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Demons-Bee/SlideViewControllerDemo/ac70c53787eb9cb6dbced5ae788b077d8fd49ed8/SlideViewControllerDemo/nav_bg.png -------------------------------------------------------------------------------- /SlideViewControllerDemo/slide.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Demons-Bee/SlideViewControllerDemo/ac70c53787eb9cb6dbced5ae788b077d8fd49ed8/SlideViewControllerDemo/slide.gif -------------------------------------------------------------------------------- /SlideViewControllerDemo/tab_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Demons-Bee/SlideViewControllerDemo/ac70c53787eb9cb6dbced5ae788b077d8fd49ed8/SlideViewControllerDemo/tab_bg.png -------------------------------------------------------------------------------- /SlideViewControllerDemo/tab_bg_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Demons-Bee/SlideViewControllerDemo/ac70c53787eb9cb6dbced5ae788b077d8fd49ed8/SlideViewControllerDemo/tab_bg_pressed.png -------------------------------------------------------------------------------- /SlideViewControllerDemo/tabbar_discover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Demons-Bee/SlideViewControllerDemo/ac70c53787eb9cb6dbced5ae788b077d8fd49ed8/SlideViewControllerDemo/tabbar_discover.png -------------------------------------------------------------------------------- /SlideViewControllerDemo/tabbar_discover_highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Demons-Bee/SlideViewControllerDemo/ac70c53787eb9cb6dbced5ae788b077d8fd49ed8/SlideViewControllerDemo/tabbar_discover_highlighted.png -------------------------------------------------------------------------------- /SlideViewControllerDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | cn.com.misol.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SlideViewControllerDemoTests/SlideViewControllerDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SlideViewControllerDemoTests.m 3 | // SlideViewControllerDemoTests 4 | // 5 | // Created by 胡大函 on 14/10/17. 6 | // Copyright (c) 2014年 HuDahan_payMoreGainMore. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface SlideViewControllerDemoTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation SlideViewControllerDemoTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------