├── .gitignore ├── ReadMe.md ├── SlideMenuController.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── SlideMenuController ├── AppDelegate.h ├── AppDelegate.m ├── ContentViewController.h ├── ContentViewController.m ├── DetailViewController.h ├── DetailViewController.m ├── Master2ViewController.h ├── Master2ViewController.m ├── Master2ViewController.xib ├── MasterViewController.h ├── MasterViewController.m ├── MasterViewController.xib ├── MenuViewController.h ├── MenuViewController.m ├── MenuViewController.xib ├── SlideMenuController-Info.plist ├── SlideMenuController-Prefix.pch ├── SlideNavigationController.h ├── SlideNavigationController.m ├── en.lproj │ ├── DetailViewController.xib │ └── InfoPlist.strings └── main.m └── screen.png /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | .DS_Store 3 | *.xcodeproj/*.pbxuser 4 | *.xcodeproj/*.mode1v3 5 | *.xcodeproj/*.perspectivev3 6 | *.xcodeproj/xcuserdata/* 7 | *.xcodeproj/project.xcworkspace/xcuserdata/* 8 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | ## Old Version! 2 | version 2 is available at https://github.com/inonb/SlideMenuController2. 3 | 4 | 5 | SlideMenuController 6 | =========================== 7 | 8 | iOS(iPhone) slide side menu controller. It's demo of facebook.app like slide global menu, switching of navigation, content view, rotation transform. 9 | 10 | ![SlideMenuController](https://github.com/inonb/SlideMenuController/raw/master/screen.png "SlideMenuController") 11 | 12 | License 13 | =============== 14 | 15 | Licensed under the Apache License, Version 2.0. 16 | -------------------------------------------------------------------------------- /SlideMenuController.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7B165EB9149E07B9008A64F3 /* MenuViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7B165EB8149E07B9008A64F3 /* MenuViewController.xib */; }; 11 | 7B2837D0149AF9C5005CC11C /* ContentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B2837CF149AF9C5005CC11C /* ContentViewController.m */; }; 12 | 7B9B8B99149AEF990016DA53 /* SlideNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B9B8B98149AEF990016DA53 /* SlideNavigationController.m */; }; 13 | 7BA2F2C6149B465D0056D09B /* MasterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7BA2F2C5149B465D0056D09B /* MasterViewController.xib */; }; 14 | 7BF05ED314920E09001834C3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7BF05ED214920E09001834C3 /* UIKit.framework */; }; 15 | 7BF05ED514920E09001834C3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7BF05ED414920E09001834C3 /* Foundation.framework */; }; 16 | 7BF05ED714920E09001834C3 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7BF05ED614920E09001834C3 /* CoreGraphics.framework */; }; 17 | 7BF05EDD14920E0A001834C3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7BF05EDB14920E0A001834C3 /* InfoPlist.strings */; }; 18 | 7BF05EDF14920E0A001834C3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BF05EDE14920E0A001834C3 /* main.m */; }; 19 | 7BF05EE314920E0A001834C3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BF05EE214920E0A001834C3 /* AppDelegate.m */; }; 20 | 7BF05EE614920E0A001834C3 /* MenuViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BF05EE514920E0A001834C3 /* MenuViewController.m */; }; 21 | 7BF05EE914920E0A001834C3 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BF05EE814920E0A001834C3 /* DetailViewController.m */; }; 22 | 7BF05EEF14920E0A001834C3 /* DetailViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7BF05EED14920E0A001834C3 /* DetailViewController.xib */; }; 23 | 7BF05F2B149212E0001834C3 /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BF05F2A149212E0001834C3 /* MasterViewController.m */; }; 24 | 7BF05F2E14922B60001834C3 /* Master2ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BF05F2D14922B60001834C3 /* Master2ViewController.m */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | 7B165EB8149E07B9008A64F3 /* MenuViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MenuViewController.xib; sourceTree = ""; }; 29 | 7B2837CE149AF9C5005CC11C /* ContentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentViewController.h; sourceTree = ""; }; 30 | 7B2837CF149AF9C5005CC11C /* ContentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContentViewController.m; sourceTree = ""; }; 31 | 7B9B8B97149AEF990016DA53 /* SlideNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlideNavigationController.h; sourceTree = ""; }; 32 | 7B9B8B98149AEF990016DA53 /* SlideNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SlideNavigationController.m; sourceTree = ""; }; 33 | 7BA2F2C5149B465D0056D09B /* MasterViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MasterViewController.xib; sourceTree = ""; }; 34 | 7BF05ECE14920E09001834C3 /* SlideMenuController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SlideMenuController.app; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 7BF05ED214920E09001834C3 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 36 | 7BF05ED414920E09001834C3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 37 | 7BF05ED614920E09001834C3 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 38 | 7BF05EDA14920E0A001834C3 /* SlideMenuController-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SlideMenuController-Info.plist"; sourceTree = ""; }; 39 | 7BF05EDC14920E0A001834C3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 40 | 7BF05EDE14920E0A001834C3 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 41 | 7BF05EE014920E0A001834C3 /* SlideMenuController-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SlideMenuController-Prefix.pch"; sourceTree = ""; }; 42 | 7BF05EE114920E0A001834C3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 43 | 7BF05EE214920E0A001834C3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 44 | 7BF05EE414920E0A001834C3 /* MenuViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MenuViewController.h; sourceTree = ""; }; 45 | 7BF05EE514920E0A001834C3 /* MenuViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MenuViewController.m; sourceTree = ""; }; 46 | 7BF05EE714920E0A001834C3 /* DetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; }; 47 | 7BF05EE814920E0A001834C3 /* DetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; }; 48 | 7BF05EEE14920E0A001834C3 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/DetailViewController.xib; sourceTree = ""; }; 49 | 7BF05F29149212E0001834C3 /* MasterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = ""; }; 50 | 7BF05F2A149212E0001834C3 /* MasterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = ""; }; 51 | 7BF05F2C14922B60001834C3 /* Master2ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Master2ViewController.h; sourceTree = ""; }; 52 | 7BF05F2D14922B60001834C3 /* Master2ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Master2ViewController.m; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | 7BF05ECB14920E09001834C3 /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | 7BF05ED314920E09001834C3 /* UIKit.framework in Frameworks */, 61 | 7BF05ED514920E09001834C3 /* Foundation.framework in Frameworks */, 62 | 7BF05ED714920E09001834C3 /* CoreGraphics.framework in Frameworks */, 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 7BF05EC314920E09001834C3 = { 70 | isa = PBXGroup; 71 | children = ( 72 | 7BF05ED814920E09001834C3 /* SlideMenuController */, 73 | 7BF05ED114920E09001834C3 /* Frameworks */, 74 | 7BF05ECF14920E09001834C3 /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 7BF05ECF14920E09001834C3 /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 7BF05ECE14920E09001834C3 /* SlideMenuController.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 7BF05ED114920E09001834C3 /* Frameworks */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 7BF05ED214920E09001834C3 /* UIKit.framework */, 90 | 7BF05ED414920E09001834C3 /* Foundation.framework */, 91 | 7BF05ED614920E09001834C3 /* CoreGraphics.framework */, 92 | ); 93 | name = Frameworks; 94 | sourceTree = ""; 95 | }; 96 | 7BF05ED814920E09001834C3 /* SlideMenuController */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 7BF05EE114920E0A001834C3 /* AppDelegate.h */, 100 | 7BF05EE214920E0A001834C3 /* AppDelegate.m */, 101 | 7BF05EE414920E0A001834C3 /* MenuViewController.h */, 102 | 7BF05EE514920E0A001834C3 /* MenuViewController.m */, 103 | 7B165EB8149E07B9008A64F3 /* MenuViewController.xib */, 104 | 7B9B8B97149AEF990016DA53 /* SlideNavigationController.h */, 105 | 7B9B8B98149AEF990016DA53 /* SlideNavigationController.m */, 106 | 7B2837CE149AF9C5005CC11C /* ContentViewController.h */, 107 | 7B2837CF149AF9C5005CC11C /* ContentViewController.m */, 108 | 7BF05F29149212E0001834C3 /* MasterViewController.h */, 109 | 7BF05F2A149212E0001834C3 /* MasterViewController.m */, 110 | 7BA2F2C5149B465D0056D09B /* MasterViewController.xib */, 111 | 7BF05F2C14922B60001834C3 /* Master2ViewController.h */, 112 | 7BF05F2D14922B60001834C3 /* Master2ViewController.m */, 113 | 7BF05EE714920E0A001834C3 /* DetailViewController.h */, 114 | 7BF05EE814920E0A001834C3 /* DetailViewController.m */, 115 | 7BF05EED14920E0A001834C3 /* DetailViewController.xib */, 116 | 7BF05ED914920E0A001834C3 /* Supporting Files */, 117 | ); 118 | path = SlideMenuController; 119 | sourceTree = ""; 120 | }; 121 | 7BF05ED914920E0A001834C3 /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 7BF05EDA14920E0A001834C3 /* SlideMenuController-Info.plist */, 125 | 7BF05EDB14920E0A001834C3 /* InfoPlist.strings */, 126 | 7BF05EDE14920E0A001834C3 /* main.m */, 127 | 7BF05EE014920E0A001834C3 /* SlideMenuController-Prefix.pch */, 128 | ); 129 | name = "Supporting Files"; 130 | sourceTree = ""; 131 | }; 132 | /* End PBXGroup section */ 133 | 134 | /* Begin PBXNativeTarget section */ 135 | 7BF05ECD14920E09001834C3 /* SlideMenuController */ = { 136 | isa = PBXNativeTarget; 137 | buildConfigurationList = 7BF05EF214920E0A001834C3 /* Build configuration list for PBXNativeTarget "SlideMenuController" */; 138 | buildPhases = ( 139 | 7BF05ECA14920E09001834C3 /* Sources */, 140 | 7BF05ECB14920E09001834C3 /* Frameworks */, 141 | 7BF05ECC14920E09001834C3 /* Resources */, 142 | ); 143 | buildRules = ( 144 | ); 145 | dependencies = ( 146 | ); 147 | name = SlideMenuController; 148 | productName = SlideMenuController; 149 | productReference = 7BF05ECE14920E09001834C3 /* SlideMenuController.app */; 150 | productType = "com.apple.product-type.application"; 151 | }; 152 | /* End PBXNativeTarget section */ 153 | 154 | /* Begin PBXProject section */ 155 | 7BF05EC514920E09001834C3 /* Project object */ = { 156 | isa = PBXProject; 157 | attributes = { 158 | LastUpgradeCheck = 0420; 159 | ORGANIZATIONNAME = "Inoue Takayuki"; 160 | }; 161 | buildConfigurationList = 7BF05EC814920E09001834C3 /* Build configuration list for PBXProject "SlideMenuController" */; 162 | compatibilityVersion = "Xcode 3.2"; 163 | developmentRegion = English; 164 | hasScannedForEncodings = 0; 165 | knownRegions = ( 166 | en, 167 | ); 168 | mainGroup = 7BF05EC314920E09001834C3; 169 | productRefGroup = 7BF05ECF14920E09001834C3 /* Products */; 170 | projectDirPath = ""; 171 | projectRoot = ""; 172 | targets = ( 173 | 7BF05ECD14920E09001834C3 /* SlideMenuController */, 174 | ); 175 | }; 176 | /* End PBXProject section */ 177 | 178 | /* Begin PBXResourcesBuildPhase section */ 179 | 7BF05ECC14920E09001834C3 /* Resources */ = { 180 | isa = PBXResourcesBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | 7BF05EDD14920E0A001834C3 /* InfoPlist.strings in Resources */, 184 | 7BF05EEF14920E0A001834C3 /* DetailViewController.xib in Resources */, 185 | 7BA2F2C6149B465D0056D09B /* MasterViewController.xib in Resources */, 186 | 7B165EB9149E07B9008A64F3 /* MenuViewController.xib in Resources */, 187 | ); 188 | runOnlyForDeploymentPostprocessing = 0; 189 | }; 190 | /* End PBXResourcesBuildPhase section */ 191 | 192 | /* Begin PBXSourcesBuildPhase section */ 193 | 7BF05ECA14920E09001834C3 /* Sources */ = { 194 | isa = PBXSourcesBuildPhase; 195 | buildActionMask = 2147483647; 196 | files = ( 197 | 7BF05EDF14920E0A001834C3 /* main.m in Sources */, 198 | 7BF05EE314920E0A001834C3 /* AppDelegate.m in Sources */, 199 | 7BF05EE614920E0A001834C3 /* MenuViewController.m in Sources */, 200 | 7BF05EE914920E0A001834C3 /* DetailViewController.m in Sources */, 201 | 7BF05F2B149212E0001834C3 /* MasterViewController.m in Sources */, 202 | 7BF05F2E14922B60001834C3 /* Master2ViewController.m in Sources */, 203 | 7B9B8B99149AEF990016DA53 /* SlideNavigationController.m in Sources */, 204 | 7B2837D0149AF9C5005CC11C /* ContentViewController.m in Sources */, 205 | ); 206 | runOnlyForDeploymentPostprocessing = 0; 207 | }; 208 | /* End PBXSourcesBuildPhase section */ 209 | 210 | /* Begin PBXVariantGroup section */ 211 | 7BF05EDB14920E0A001834C3 /* InfoPlist.strings */ = { 212 | isa = PBXVariantGroup; 213 | children = ( 214 | 7BF05EDC14920E0A001834C3 /* en */, 215 | ); 216 | name = InfoPlist.strings; 217 | sourceTree = ""; 218 | }; 219 | 7BF05EED14920E0A001834C3 /* DetailViewController.xib */ = { 220 | isa = PBXVariantGroup; 221 | children = ( 222 | 7BF05EEE14920E0A001834C3 /* en */, 223 | ); 224 | name = DetailViewController.xib; 225 | sourceTree = ""; 226 | }; 227 | /* End PBXVariantGroup section */ 228 | 229 | /* Begin XCBuildConfiguration section */ 230 | 7BF05EF014920E0A001834C3 /* Debug */ = { 231 | isa = XCBuildConfiguration; 232 | buildSettings = { 233 | ALWAYS_SEARCH_USER_PATHS = NO; 234 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 235 | CLANG_ENABLE_OBJC_ARC = YES; 236 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 237 | COPY_PHASE_STRIP = NO; 238 | GCC_C_LANGUAGE_STANDARD = gnu99; 239 | GCC_DYNAMIC_NO_PIC = NO; 240 | GCC_OPTIMIZATION_LEVEL = 0; 241 | GCC_PREPROCESSOR_DEFINITIONS = ( 242 | "DEBUG=1", 243 | "$(inherited)", 244 | ); 245 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 246 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 247 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 248 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 249 | GCC_WARN_UNUSED_VARIABLE = YES; 250 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 251 | SDKROOT = iphoneos; 252 | }; 253 | name = Debug; 254 | }; 255 | 7BF05EF114920E0A001834C3 /* Release */ = { 256 | isa = XCBuildConfiguration; 257 | buildSettings = { 258 | ALWAYS_SEARCH_USER_PATHS = NO; 259 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 260 | CLANG_ENABLE_OBJC_ARC = YES; 261 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 262 | COPY_PHASE_STRIP = YES; 263 | GCC_C_LANGUAGE_STANDARD = gnu99; 264 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 265 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 266 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 267 | GCC_WARN_UNUSED_VARIABLE = YES; 268 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 269 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 270 | SDKROOT = iphoneos; 271 | VALIDATE_PRODUCT = YES; 272 | }; 273 | name = Release; 274 | }; 275 | 7BF05EF314920E0A001834C3 /* Debug */ = { 276 | isa = XCBuildConfiguration; 277 | buildSettings = { 278 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 279 | GCC_PREFIX_HEADER = "SlideMenuController/SlideMenuController-Prefix.pch"; 280 | INFOPLIST_FILE = "SlideMenuController/SlideMenuController-Info.plist"; 281 | PRODUCT_NAME = "$(TARGET_NAME)"; 282 | WRAPPER_EXTENSION = app; 283 | }; 284 | name = Debug; 285 | }; 286 | 7BF05EF414920E0A001834C3 /* Release */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 290 | GCC_PREFIX_HEADER = "SlideMenuController/SlideMenuController-Prefix.pch"; 291 | INFOPLIST_FILE = "SlideMenuController/SlideMenuController-Info.plist"; 292 | PRODUCT_NAME = "$(TARGET_NAME)"; 293 | WRAPPER_EXTENSION = app; 294 | }; 295 | name = Release; 296 | }; 297 | /* End XCBuildConfiguration section */ 298 | 299 | /* Begin XCConfigurationList section */ 300 | 7BF05EC814920E09001834C3 /* Build configuration list for PBXProject "SlideMenuController" */ = { 301 | isa = XCConfigurationList; 302 | buildConfigurations = ( 303 | 7BF05EF014920E0A001834C3 /* Debug */, 304 | 7BF05EF114920E0A001834C3 /* Release */, 305 | ); 306 | defaultConfigurationIsVisible = 0; 307 | defaultConfigurationName = Release; 308 | }; 309 | 7BF05EF214920E0A001834C3 /* Build configuration list for PBXNativeTarget "SlideMenuController" */ = { 310 | isa = XCConfigurationList; 311 | buildConfigurations = ( 312 | 7BF05EF314920E0A001834C3 /* Debug */, 313 | 7BF05EF414920E0A001834C3 /* Release */, 314 | ); 315 | defaultConfigurationIsVisible = 0; 316 | defaultConfigurationName = Release; 317 | }; 318 | /* End XCConfigurationList section */ 319 | }; 320 | rootObject = 7BF05EC514920E09001834C3 /* Project object */; 321 | } 322 | -------------------------------------------------------------------------------- /SlideMenuController.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SlideMenuController/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SlideMenuController 4 | // 5 | // Created by Inoue Takayuki on 11/12/09. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SlideMenuController/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SlideMenuController 4 | // 5 | // Created by Inoue Takayuki on 11/12/09. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "MenuViewController.h" 11 | 12 | @implementation AppDelegate 13 | 14 | @synthesize window = _window; 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 19 | self.window.backgroundColor = [UIColor whiteColor]; 20 | 21 | MenuViewController *menuViewController = [[MenuViewController alloc] initWithNibName:@"MenuViewController" bundle:nil]; 22 | 23 | self.window.rootViewController = menuViewController; 24 | [self.window makeKeyAndVisible]; 25 | return YES; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /SlideMenuController/ContentViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContentViewController.h 3 | // SlideMenuController 4 | // 5 | // Created by Inoue Takayuki on 11/12/16. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SlideNavigationController.h" 11 | 12 | @interface ContentViewController : UIViewController 13 | @property (nonatomic, retain) SlideNavigationController *navigationController; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SlideMenuController/ContentViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ContentViewController.m 3 | // SlideMenuController 4 | // 5 | // Created by Inoue Takayuki on 11/12/16. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import "ContentViewController.h" 10 | 11 | @implementation ContentViewController 12 | @synthesize navigationController; 13 | 14 | - (void)viewDidUnload 15 | { 16 | self.navigationController = nil; 17 | [super viewDidUnload]; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /SlideMenuController/DetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.h 3 | // SlideMenuController 4 | // 5 | // Created by Inoue Takayuki on 11/12/09. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ContentViewController.h" 11 | 12 | @interface DetailViewController : ContentViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /SlideMenuController/DetailViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.m 3 | // SlideMenuController 4 | // 5 | // Created by Inoue Takayuki on 11/12/09. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import "DetailViewController.h" 10 | #import "MasterViewController.h" 11 | #import "AppDelegate.h" 12 | 13 | @implementation DetailViewController 14 | 15 | #pragma mark - Managing the detail item 16 | 17 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 18 | { 19 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 20 | if (self) { 21 | self.title = NSLocalizedString(@"Detail", @"Detail"); 22 | } 23 | return self; 24 | } 25 | 26 | 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /SlideMenuController/Master2ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MasterViewController.h 3 | // sample 4 | // 5 | // Created by Inoue Takayuki on 11/12/09. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MasterViewController.h" 11 | 12 | @interface Master2ViewController : MasterViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /SlideMenuController/Master2ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // Master2ViewController.m 3 | // SlideMenuController 4 | // 5 | // Created by Inoue Takayuki on 11/12/09. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import "Master2ViewController.h" 10 | 11 | @implementation Master2ViewController 12 | 13 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 14 | { 15 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 16 | if (self) { 17 | self.title = NSLocalizedString(@"Master2", @"Master2"); 18 | } 19 | return self; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /SlideMenuController/Master2ViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11D50b 6 | 1938 7 | 1138.32 8 | 568.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 933 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | IBUITableView 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 319 37 | 38 | 39 | 40 | 274 41 | {320, 436} 42 | 43 | 44 | 45 | _NS:418 46 | 47 | 3 48 | MCAwAA 49 | 50 | YES 51 | IBCocoaTouchFramework 52 | YES 53 | 1 54 | 0 55 | YES 56 | 44 57 | 22 58 | 22 59 | 60 | 61 | {{0, 44}, {320, 436}} 62 | 63 | 64 | 65 | 66 | 1 67 | MC4xMTg5MDgyMjk1IDAuNTY0MTAwODYzNiAwLjY5ODkwOTk4MzkAA 68 | 69 | 70 | NO 71 | 72 | 73 | IBUIScreenMetrics 74 | 75 | YES 76 | 77 | 78 | 79 | 80 | 81 | {320, 480} 82 | {480, 320} 83 | 84 | 85 | IBCocoaTouchFramework 86 | iPhone/iPod touch Full Screen 87 | 88 | IBCocoaTouchFramework 89 | 90 | 91 | 92 | 93 | 94 | 95 | view 96 | 97 | 98 | 99 | 3 100 | 101 | 102 | 103 | tableView 104 | 105 | 106 | 107 | 7 108 | 109 | 110 | 111 | dataSource 112 | 113 | 114 | 115 | 5 116 | 117 | 118 | 119 | delegate 120 | 121 | 122 | 123 | 6 124 | 125 | 126 | 127 | 128 | 129 | 0 130 | 131 | 132 | 133 | 134 | 135 | 1 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | -1 144 | 145 | 146 | File's Owner 147 | 148 | 149 | -2 150 | 151 | 152 | 153 | 154 | 4 155 | 156 | 157 | 158 | 159 | 160 | 161 | Master2ViewController 162 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 163 | UIResponder 164 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 165 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 166 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 167 | 168 | 169 | 170 | 171 | 172 | 7 173 | 174 | 175 | 176 | 177 | ContentViewController 178 | UIViewController 179 | 180 | IBProjectSource 181 | ./Classes/ContentViewController.h 182 | 183 | 184 | 185 | Master2ViewController 186 | MasterViewController 187 | 188 | IBProjectSource 189 | ./Classes/Master2ViewController.h 190 | 191 | 192 | 193 | MasterViewController 194 | ContentViewController 195 | 196 | tableView 197 | UITableView 198 | 199 | 200 | tableView 201 | 202 | tableView 203 | UITableView 204 | 205 | 206 | 207 | IBProjectSource 208 | ./Classes/MasterViewController.h 209 | 210 | 211 | 212 | 213 | 0 214 | IBCocoaTouchFramework 215 | YES 216 | 3 217 | 933 218 | 219 | 220 | -------------------------------------------------------------------------------- /SlideMenuController/MasterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MasterViewController.h 3 | // sample 4 | // 5 | // Created by Inoue Takayuki on 11/12/09. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ContentViewController.h" 11 | 12 | @interface MasterViewController : ContentViewController 13 | 14 | @property (strong, nonatomic) IBOutlet UITableView *tableView; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /SlideMenuController/MasterViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MasterViewController.m 3 | // SlideMenuController 4 | // 5 | // Created by Inoue Takayuki on 11/12/09. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import "MasterViewController.h" 10 | #import "DetailViewController.h" 11 | #import "AppDelegate.h" 12 | #import "MenuViewController.h" 13 | 14 | @implementation MasterViewController 15 | 16 | @synthesize tableView; 17 | 18 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 19 | { 20 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 21 | if (self) { 22 | self.title = NSLocalizedString(@"Master", @"Master"); 23 | } 24 | return self; 25 | } 26 | 27 | - (void)viewDidUnload 28 | { 29 | self.tableView = nil; 30 | [super viewDidUnload]; 31 | } 32 | 33 | #pragma mark UITableView Delegate & Datasource 34 | 35 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 36 | { 37 | return 1; 38 | } 39 | 40 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 41 | { 42 | return 1; 43 | } 44 | 45 | - (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 46 | { 47 | static NSString *CellIdentifier = @"Cell"; 48 | 49 | UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier]; 50 | if (cell == nil) { 51 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 52 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 53 | } 54 | 55 | cell.textLabel.text = NSLocalizedString(@"Detail", @"Detail"); 56 | return cell; 57 | } 58 | 59 | - (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 60 | { 61 | DetailViewController *controller = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil]; 62 | [self.navigationController pushViewController:controller animated:YES]; 63 | 64 | [aTableView deselectRowAtIndexPath:indexPath animated:YES]; 65 | } 66 | 67 | - (void)slide:(id)sender 68 | { 69 | AppDelegate* appDelegate = [[UIApplication sharedApplication] delegate]; 70 | MenuViewController *rootViewController = (MenuViewController *)appDelegate.window.rootViewController; 71 | [rootViewController slide:nil]; 72 | self.tableView.scrollsToTop = !rootViewController.isMenu; 73 | } 74 | 75 | @end -------------------------------------------------------------------------------- /SlideMenuController/MasterViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11C74 6 | 1934 7 | 1138.23 8 | 567.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 931 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | IBUITableView 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 274 41 | {320, 416} 42 | 43 | 44 | _NS:418 45 | 46 | 3 47 | MQA 48 | 49 | YES 50 | IBCocoaTouchFramework 51 | YES 52 | 1 53 | 0 54 | YES 55 | 44 56 | 22 57 | 22 58 | 59 | 60 | {{0, 64}, {320, 416}} 61 | 62 | 63 | 64 | 65 | 3 66 | MQA 67 | 68 | 2 69 | 70 | 71 | 72 | 73 | NO 74 | 75 | IBCocoaTouchFramework 76 | 77 | 78 | 79 | 80 | 81 | 82 | view 83 | 84 | 85 | 86 | 3 87 | 88 | 89 | 90 | tableView 91 | 92 | 93 | 94 | 7 95 | 96 | 97 | 98 | dataSource 99 | 100 | 101 | 102 | 5 103 | 104 | 105 | 106 | delegate 107 | 108 | 109 | 110 | 6 111 | 112 | 113 | 114 | 115 | 116 | 0 117 | 118 | 119 | 120 | 121 | 122 | 1 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -1 131 | 132 | 133 | File's Owner 134 | 135 | 136 | -2 137 | 138 | 139 | 140 | 141 | 4 142 | 143 | 144 | 145 | 146 | 147 | 148 | MasterViewController 149 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 150 | UIResponder 151 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 152 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 153 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 154 | 155 | 156 | 157 | 158 | 159 | 7 160 | 161 | 162 | 163 | 164 | ContentViewController 165 | UIViewController 166 | 167 | IBProjectSource 168 | ./Classes/ContentViewController.h 169 | 170 | 171 | 172 | MasterViewController 173 | ContentViewController 174 | 175 | tableView 176 | UITableView 177 | 178 | 179 | tableView 180 | 181 | tableView 182 | UITableView 183 | 184 | 185 | 186 | IBProjectSource 187 | ./Classes/MasterViewController.h 188 | 189 | 190 | 191 | 192 | 0 193 | IBCocoaTouchFramework 194 | YES 195 | 3 196 | 931 197 | 198 | 199 | -------------------------------------------------------------------------------- /SlideMenuController/MenuViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.h 3 | // SlideMenuController 4 | // 5 | // Created by Inoue Takayuki on 11/12/09. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class SlideNavigationController; 12 | 13 | @interface MenuViewController : UIViewController 14 | 15 | @property (strong, nonatomic) IBOutlet UIView *contentView; 16 | @property (strong, nonatomic) IBOutlet UITableView *tableView; 17 | @property (strong, nonatomic) IBOutlet UISearchBar *searchBar; 18 | @property (assign) BOOL isMenu; 19 | 20 | - (IBAction)slide:(id)sender; 21 | - (CGFloat)slideWidth; 22 | - (void)addViewController:(SlideNavigationController *)navigationController withTitle:(NSString*)title; 23 | @end 24 | -------------------------------------------------------------------------------- /SlideMenuController/MenuViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.m 3 | // SlideMenuController 4 | // 5 | // Created by Inoue Takayuki on 11/12/09. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import "MenuViewController.h" 10 | #import "MasterViewController.h" 11 | #import "Master2ViewController.h" 12 | #import "SlideNavigationController.h" 13 | 14 | @implementation MenuViewController 15 | 16 | @synthesize contentView; 17 | @synthesize searchBar; 18 | @synthesize tableView; 19 | @synthesize isMenu; 20 | 21 | #pragma mark - View lifecycle 22 | 23 | - (void)viewDidLoad 24 | { 25 | [super viewDidLoad]; 26 | 27 | ContentViewController *controller = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil]; 28 | SlideNavigationController *navigationController = [[SlideNavigationController alloc] initWithRootViewController:controller]; 29 | 30 | [self addViewController:navigationController withTitle:@"Master"]; 31 | 32 | ContentViewController *controller2 = [[Master2ViewController alloc] initWithNibName:@"MasterViewController" bundle:nil]; 33 | SlideNavigationController *navigationController2 = [[SlideNavigationController alloc] initWithRootViewController:controller2]; 34 | 35 | [self addViewController:navigationController2 withTitle:@"Master2"]; 36 | 37 | self.tableView.scrollsToTop = NO; 38 | isMenu = NO; 39 | } 40 | 41 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 42 | { 43 | return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); 44 | } 45 | 46 | #pragma mark Child ViewControllers Management 47 | 48 | -(void)addViewController:(SlideNavigationController *)navigationController withTitle:(NSString*)title 49 | { 50 | navigationController.title = title; 51 | navigationController.menuViewController = self; 52 | [self addChildViewController:navigationController]; 53 | 54 | if([self.childViewControllers count] == 1) 55 | { 56 | [self.contentView addSubview:navigationController.view]; 57 | } 58 | } 59 | 60 | #pragma mark UITableView Delegate & Datasource 61 | 62 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 63 | { 64 | return 1; 65 | } 66 | 67 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 68 | { 69 | return [self.childViewControllers count]; 70 | } 71 | 72 | - (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 73 | { 74 | static NSString *CellIdentifier = @"Cell"; 75 | 76 | UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier]; 77 | if (cell == nil) { 78 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 79 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 80 | cell.textLabel.textColor = [UIColor whiteColor]; 81 | } 82 | 83 | SlideNavigationController *navigation = [self.childViewControllers objectAtIndex:indexPath.row]; 84 | cell.textLabel.text = navigation.title; 85 | 86 | return cell; 87 | } 88 | 89 | - (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 90 | { 91 | SlideNavigationController *navigation = [self.childViewControllers objectAtIndex:indexPath.row]; 92 | 93 | NSArray *views = [self.contentView subviews]; 94 | for (UIView *view in views) { 95 | [view removeFromSuperview]; 96 | } 97 | [self.contentView addSubview:navigation.view]; 98 | 99 | [self slide:nil]; 100 | 101 | if ([self.searchBar isFirstResponder]) { 102 | [self.searchBar resignFirstResponder]; 103 | } 104 | 105 | [aTableView deselectRowAtIndexPath:indexPath animated:YES]; 106 | } 107 | 108 | #pragma mark Slide Menu 109 | 110 | - (IBAction)slide:(id)sender 111 | { 112 | isMenu = !isMenu; 113 | 114 | [UIView animateWithDuration:0.2 animations:^{ 115 | CGFloat originX = isMenu ? [self slideWidth] : 0; 116 | CGRect frame = contentView.frame; 117 | frame.origin.x = originX; 118 | contentView.frame = frame; 119 | } completion:^(BOOL finished){ 120 | self.tableView.scrollsToTop = isMenu; 121 | }]; 122 | } 123 | 124 | - (CGFloat)slideWidth 125 | { 126 | return 260; 127 | // if (UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation])) { 128 | // return 420; 129 | // } else { 130 | // return 260; 131 | // } 132 | } 133 | 134 | @end 135 | -------------------------------------------------------------------------------- /SlideMenuController/SlideMenuController-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | com.inouetakayuki.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /SlideMenuController/SlideMenuController-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'SlideMenuController' target in the 'SlideMenuController' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /SlideMenuController/SlideNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SlideNavigationController.h 3 | // SlideMenuController 4 | // 5 | // Created by Inoue Takayuki on 11/12/16. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MenuViewController; 12 | @class ContentViewController; 13 | 14 | @interface SlideNavigationController : UIViewController 15 | 16 | @property (nonatomic, strong) UINavigationBar *navigationBar; 17 | @property (nonatomic, strong) UIView *contentView; 18 | @property (nonatomic, strong, readonly) UIViewController *rootViewController; 19 | @property (nonatomic, strong) MenuViewController *menuViewController; 20 | 21 | - (id)initWithRootViewController:(UIViewController *)rootViewController; 22 | - (void)pushViewController:(ContentViewController *)controller animated:(BOOL)animated; 23 | - (void)popViewController:(BOOL)animated; 24 | - (CGFloat)navigationBarHeight; 25 | - (CGFloat)contentWidth; 26 | @end 27 | -------------------------------------------------------------------------------- /SlideMenuController/SlideNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SlideNavigationController.m 3 | // SlideMenuController 4 | // 5 | // Created by Inoue Takayuki on 11/12/16. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import "SlideNavigationController.h" 10 | #import "ContentViewController.h" 11 | 12 | @implementation SlideNavigationController 13 | 14 | @synthesize navigationBar; 15 | @synthesize contentView; 16 | @synthesize menuViewController; 17 | @synthesize rootViewController = _rootViewController; 18 | 19 | - (id)init 20 | { 21 | self = [super init]; 22 | if (self) { 23 | 24 | CGRect masterRect = [[UIScreen mainScreen] bounds]; 25 | CGRect contentFrame = CGRectMake(0, [self navigationBarHeight], masterRect.size.width, masterRect.size.height - [self navigationBarHeight]); 26 | CGRect navigationFrame = CGRectMake(0, 0, masterRect.size.width, [self navigationBarHeight]); 27 | 28 | self.view = [[UIView alloc] initWithFrame:masterRect]; 29 | self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 30 | 31 | self.contentView = [[UIView alloc] initWithFrame:contentFrame]; 32 | self.contentView.backgroundColor = [UIColor whiteColor]; 33 | self.contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 34 | [self.view addSubview:self.contentView]; 35 | 36 | self.navigationBar = [[UINavigationBar alloc] initWithFrame:navigationFrame]; 37 | self.navigationBar.autoresizingMask = UIViewAutoresizingFlexibleWidth; 38 | self.navigationBar.delegate = self; 39 | [self.view insertSubview:self.navigationBar aboveSubview:self.contentView]; 40 | 41 | } 42 | return self; 43 | } 44 | 45 | - (id)initWithRootViewController:(ContentViewController *)rootViewController 46 | { 47 | self = [self init]; 48 | if(self) { 49 | _rootViewController = rootViewController; 50 | UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithTitle:@"menu" style:UIBarButtonItemStyleBordered target:rootViewController action:@selector(slide:)]; 51 | rootViewController.navigationItem.leftBarButtonItem = menuButton; 52 | 53 | [self addChildViewController:rootViewController]; 54 | [self.contentView addSubview:rootViewController.view]; 55 | [self.navigationBar pushNavigationItem:rootViewController.navigationItem animated:YES]; 56 | 57 | rootViewController.navigationController = self; 58 | } 59 | return self; 60 | } 61 | 62 | - (void)viewDidUnload 63 | { 64 | _rootViewController = nil; 65 | self.navigationBar = nil; 66 | self.contentView = nil; 67 | self.menuViewController = nil; 68 | [super viewDidUnload]; 69 | } 70 | 71 | #pragma mark UINavigationBar Delegate 72 | 73 | - (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item 74 | { 75 | [self popViewController:YES]; 76 | return YES; 77 | } 78 | 79 | #pragma mark Child ViewControllers Management 80 | 81 | - (void)pushViewController:(ContentViewController *)controller animated:(BOOL)animated 82 | { 83 | [self addChildViewController:controller]; 84 | [self.navigationBar pushNavigationItem:controller.navigationItem animated:animated]; 85 | controller.navigationController = self; 86 | 87 | if([self.childViewControllers count] == 1) { 88 | 89 | controller.view.frame = self.contentView.bounds; 90 | [self.contentView addSubview:controller.view]; 91 | 92 | } else { 93 | 94 | UIViewController *previousController = [self.childViewControllers objectAtIndex:[self.childViewControllers count] - 2]; 95 | 96 | CGRect frame = self.contentView.bounds; 97 | if (animated) frame.origin.x = frame.size.width; 98 | controller.view.frame = frame; 99 | 100 | [self transitionFromViewController:previousController 101 | toViewController:controller 102 | duration:0.3 103 | options:UIViewAnimationOptionTransitionNone 104 | animations:^{ 105 | if (animated) { 106 | CGRect frame; 107 | frame = previousController.view.frame; 108 | frame.origin.x = -frame.size.width; 109 | previousController.view.frame = frame; 110 | 111 | frame = controller.view.frame; 112 | frame.origin.x = 0; 113 | controller.view.frame = frame; 114 | } 115 | } 116 | completion:nil]; 117 | } 118 | } 119 | 120 | - (void)popViewController:(BOOL)animated 121 | { 122 | UIViewController *controller = [self.childViewControllers lastObject]; 123 | UIViewController *previousController = nil; 124 | if([self.childViewControllers count] > 1) { 125 | previousController = [self.childViewControllers objectAtIndex:[self.childViewControllers count] - 2]; 126 | CGRect frame = self.contentView.bounds; 127 | if (animated) frame.origin.x = -[self contentWidth]; 128 | previousController.view.frame = frame; 129 | } 130 | 131 | if([self.childViewControllers count] > 1) { 132 | previousController = [self.childViewControllers objectAtIndex:[self.childViewControllers count] - 2]; 133 | } 134 | 135 | [self transitionFromViewController: controller 136 | toViewController: previousController 137 | duration: 0.3 138 | options: UIViewAnimationOptionTransitionNone 139 | animations: ^{ 140 | if (animated) { 141 | previousController.view.frame = self.contentView.bounds; 142 | CGRect frame = self.contentView.bounds; 143 | frame.origin.x = frame.size.width; 144 | controller.view.frame = frame; 145 | } 146 | } completion: ^(BOOL finished) { 147 | [controller removeFromParentViewController]; 148 | }]; 149 | } 150 | 151 | #pragma mark Rotation 152 | 153 | - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration 154 | { 155 | [UIView animateWithDuration:duration 156 | animations:^{ 157 | [self.navigationBar sizeToFit]; 158 | CGRect contentFrame = self.contentView.frame; 159 | contentFrame.size.height = self.view.frame.size.height - [self navigationBarHeight]; 160 | contentFrame.origin.y = [self navigationBarHeight]; 161 | self.contentView.frame = contentFrame; 162 | }]; 163 | } 164 | 165 | - (CGFloat)navigationBarHeight 166 | { 167 | if (UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation])) { 168 | return 32; 169 | } else { 170 | return 44; 171 | } 172 | } 173 | 174 | - (CGFloat)contentWidth 175 | { 176 | if (UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation])) { 177 | return 480; 178 | } else { 179 | return 320; 180 | } 181 | } 182 | 183 | @end 184 | -------------------------------------------------------------------------------- /SlideMenuController/en.lproj/DetailViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11C74 6 | 1934 7 | 1138.23 8 | 567.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 931 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | IBUILabel 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 290 41 | {{130, 129}, {60, 29}} 42 | 43 | 44 | 45 | _NS:328 46 | NO 47 | YES 48 | 7 49 | NO 50 | IBCocoaTouchFramework 51 | Detail 52 | 53 | 3 54 | MC42NjY2NjY2NjY3AA 55 | 56 | 57 | 1 58 | 10 59 | 1 60 | 61 | 2 62 | 20 63 | 64 | 65 | Helvetica-Bold 66 | 20 67 | 16 68 | 69 | 70 | 71 | {{0, 64}, {320, 416}} 72 | 73 | 74 | 75 | 76 | 3 77 | MQA 78 | 79 | 2 80 | 81 | 82 | 83 | 84 | NO 85 | 86 | IBCocoaTouchFramework 87 | 88 | 89 | 90 | 91 | 92 | 93 | view 94 | 95 | 96 | 97 | 3 98 | 99 | 100 | 101 | 102 | 103 | 0 104 | 105 | 106 | 107 | 108 | 109 | 1 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | -1 118 | 119 | 120 | File's Owner 121 | 122 | 123 | -2 124 | 125 | 126 | 127 | 128 | 9 129 | 130 | 131 | 132 | 133 | 134 | 135 | DetailViewController 136 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 137 | UIResponder 138 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 139 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 140 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 141 | 142 | 143 | 144 | 145 | 146 | 9 147 | 148 | 149 | 150 | 151 | ContentViewController 152 | UIViewController 153 | 154 | IBProjectSource 155 | ./Classes/ContentViewController.h 156 | 157 | 158 | 159 | DetailViewController 160 | ContentViewController 161 | 162 | presentModal: 163 | id 164 | 165 | 166 | presentModal: 167 | 168 | presentModal: 169 | id 170 | 171 | 172 | 173 | IBProjectSource 174 | ./Classes/DetailViewController.h 175 | 176 | 177 | 178 | 179 | 0 180 | IBCocoaTouchFramework 181 | YES 182 | 3 183 | 931 184 | 185 | 186 | -------------------------------------------------------------------------------- /SlideMenuController/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /SlideMenuController/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SlideMenuController 4 | // 5 | // Created by Inoue Takayuki on 11/12/09. 6 | // Copyright (c) 2011年 Inoue Takayuki. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inonb/SlideMenuController/ea327a991b551c71ba58223270ccfe85199b5aff/screen.png --------------------------------------------------------------------------------