diff --git a/Demo Storyboard/LGSideMenuControllerDemo.xcodeproj/project.pbxproj b/Demo Storyboard/LGSideMenuControllerDemo.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c4ff7d0 --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo.xcodeproj/project.pbxproj @@ -0,0 +1,423 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 4A4243A11B6808E4008432A9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A4243A01B6808E4008432A9 /* main.m */; }; + 4A4243A41B6808E4008432A9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A4243A31B6808E4008432A9 /* AppDelegate.m */; }; + 4A4243A71B6808E4008432A9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A4243A61B6808E4008432A9 /* ViewController.m */; }; + 4A4243AA1B6808E4008432A9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4A4243A81B6808E4008432A9 /* Main.storyboard */; }; + 4A4243AC1B6808E4008432A9 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4A4243AB1B6808E4008432A9 /* Images.xcassets */; }; + 4ADAFC351B6903FF00B33211 /* image.png in Resources */ = {isa = PBXBuildFile; fileRef = 4ADAFC321B6903FF00B33211 /* image.png */; }; + 4ADAFC361B6903FF00B33211 /* image2.png in Resources */ = {isa = PBXBuildFile; fileRef = 4ADAFC331B6903FF00B33211 /* image2.png */; }; + 4ADAFC371B6903FF00B33211 /* image3.png in Resources */ = {isa = PBXBuildFile; fileRef = 4ADAFC341B6903FF00B33211 /* image3.png */; }; + 4ADAFC3A1B69190900B33211 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ADAFC391B69190900B33211 /* MainViewController.m */; }; + 4ADAFC431B691DA500B33211 /* LeftViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ADAFC3C1B691DA500B33211 /* LeftViewCell.m */; }; + 4ADAFC441B691DA500B33211 /* LeftViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ADAFC3E1B691DA500B33211 /* LeftViewController.m */; }; + 4ADAFC451B691DA500B33211 /* RightViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ADAFC401B691DA500B33211 /* RightViewCell.m */; }; + 4ADAFC461B691DA500B33211 /* RightViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ADAFC421B691DA500B33211 /* RightViewController.m */; }; + 70C5ECAFD92DA028E025DA21 /* libPods-LGSideMenuControllerDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 79D459DC11ED7AC3BC73608E /* libPods-LGSideMenuControllerDemo.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 1D786D515F2DB6D9D388116A /* Pods-LGSideMenuControllerDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LGSideMenuControllerDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-LGSideMenuControllerDemo/Pods-LGSideMenuControllerDemo.release.xcconfig"; sourceTree = ""; }; + 4A42439B1B6808E4008432A9 /* LGSideMenuControllerDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LGSideMenuControllerDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 4A42439F1B6808E4008432A9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 4A4243A01B6808E4008432A9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 4A4243A21B6808E4008432A9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 4A4243A31B6808E4008432A9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 4A4243A51B6808E4008432A9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 4A4243A61B6808E4008432A9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 4A4243A91B6808E4008432A9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 4A4243AB1B6808E4008432A9 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 4ADAFC321B6903FF00B33211 /* image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = image.png; sourceTree = ""; }; + 4ADAFC331B6903FF00B33211 /* image2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = image2.png; sourceTree = ""; }; + 4ADAFC341B6903FF00B33211 /* image3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = image3.png; sourceTree = ""; }; + 4ADAFC381B69190900B33211 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; + 4ADAFC391B69190900B33211 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; + 4ADAFC3B1B691DA500B33211 /* LeftViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LeftViewCell.h; sourceTree = ""; }; + 4ADAFC3C1B691DA500B33211 /* LeftViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LeftViewCell.m; sourceTree = ""; }; + 4ADAFC3D1B691DA500B33211 /* LeftViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LeftViewController.h; sourceTree = ""; }; + 4ADAFC3E1B691DA500B33211 /* LeftViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LeftViewController.m; sourceTree = ""; }; + 4ADAFC3F1B691DA500B33211 /* RightViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RightViewCell.h; sourceTree = ""; }; + 4ADAFC401B691DA500B33211 /* RightViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RightViewCell.m; sourceTree = ""; }; + 4ADAFC411B691DA500B33211 /* RightViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RightViewController.h; sourceTree = ""; }; + 4ADAFC421B691DA500B33211 /* RightViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RightViewController.m; sourceTree = ""; }; + 79D459DC11ED7AC3BC73608E /* libPods-LGSideMenuControllerDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-LGSideMenuControllerDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 848F56D8BFC1CBB7C8AF6C8B /* Pods-LGSideMenuControllerDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LGSideMenuControllerDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LGSideMenuControllerDemo/Pods-LGSideMenuControllerDemo.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 4A4243981B6808E4008432A9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 70C5ECAFD92DA028E025DA21 /* libPods-LGSideMenuControllerDemo.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 08E831CD732BDF55D76A1236 /* Pods */ = { + isa = PBXGroup; + children = ( + 848F56D8BFC1CBB7C8AF6C8B /* Pods-LGSideMenuControllerDemo.debug.xcconfig */, + 1D786D515F2DB6D9D388116A /* Pods-LGSideMenuControllerDemo.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 4A4243921B6808E4008432A9 = { + isa = PBXGroup; + children = ( + 4A42439D1B6808E4008432A9 /* LGSideMenuControllerDemo */, + 4A42439C1B6808E4008432A9 /* Products */, + 08E831CD732BDF55D76A1236 /* Pods */, + B91BCAF4EFD8F9FD7A03B95F /* Frameworks */, + ); + sourceTree = ""; + }; + 4A42439C1B6808E4008432A9 /* Products */ = { + isa = PBXGroup; + children = ( + 4A42439B1B6808E4008432A9 /* LGSideMenuControllerDemo.app */, + ); + name = Products; + sourceTree = ""; + }; + 4A42439D1B6808E4008432A9 /* LGSideMenuControllerDemo */ = { + isa = PBXGroup; + children = ( + 4ADAFC471B691E0F00B33211 /* Right View Controller */, + 4ADAFC481B691E1300B33211 /* Left View Controller */, + 4A4243A21B6808E4008432A9 /* AppDelegate.h */, + 4A4243A31B6808E4008432A9 /* AppDelegate.m */, + 4A4243A51B6808E4008432A9 /* ViewController.h */, + 4A4243A61B6808E4008432A9 /* ViewController.m */, + 4ADAFC381B69190900B33211 /* MainViewController.h */, + 4ADAFC391B69190900B33211 /* MainViewController.m */, + 4A4243A81B6808E4008432A9 /* Main.storyboard */, + 4ADAFC311B6903F200B33211 /* Resources */, + 4A4243AB1B6808E4008432A9 /* Images.xcassets */, + 4A42439E1B6808E4008432A9 /* Supporting Files */, + ); + path = LGSideMenuControllerDemo; + sourceTree = ""; + }; + 4A42439E1B6808E4008432A9 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 4A42439F1B6808E4008432A9 /* Info.plist */, + 4A4243A01B6808E4008432A9 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 4ADAFC311B6903F200B33211 /* Resources */ = { + isa = PBXGroup; + children = ( + 4ADAFC321B6903FF00B33211 /* image.png */, + 4ADAFC331B6903FF00B33211 /* image2.png */, + 4ADAFC341B6903FF00B33211 /* image3.png */, + ); + name = Resources; + sourceTree = ""; + }; + 4ADAFC471B691E0F00B33211 /* Right View Controller */ = { + isa = PBXGroup; + children = ( + 4ADAFC411B691DA500B33211 /* RightViewController.h */, + 4ADAFC421B691DA500B33211 /* RightViewController.m */, + 4ADAFC3F1B691DA500B33211 /* RightViewCell.h */, + 4ADAFC401B691DA500B33211 /* RightViewCell.m */, + ); + name = "Right View Controller"; + sourceTree = ""; + }; + 4ADAFC481B691E1300B33211 /* Left View Controller */ = { + isa = PBXGroup; + children = ( + 4ADAFC3D1B691DA500B33211 /* LeftViewController.h */, + 4ADAFC3E1B691DA500B33211 /* LeftViewController.m */, + 4ADAFC3B1B691DA500B33211 /* LeftViewCell.h */, + 4ADAFC3C1B691DA500B33211 /* LeftViewCell.m */, + ); + name = "Left View Controller"; + sourceTree = ""; + }; + B91BCAF4EFD8F9FD7A03B95F /* Frameworks */ = { + isa = PBXGroup; + children = ( + 79D459DC11ED7AC3BC73608E /* libPods-LGSideMenuControllerDemo.a */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 4A42439A1B6808E4008432A9 /* LGSideMenuControllerDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4A4243BE1B6808E4008432A9 /* Build configuration list for PBXNativeTarget "LGSideMenuControllerDemo" */; + buildPhases = ( + AEB5C6C3E6EE848EBB20B6C4 /* Check Pods Manifest.lock */, + 4A4243971B6808E4008432A9 /* Sources */, + 4A4243981B6808E4008432A9 /* Frameworks */, + 4A4243991B6808E4008432A9 /* Resources */, + E2536D4655B09414CE15F03D /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = LGSideMenuControllerDemo; + productName = LGSideMenuControllerDemo; + productReference = 4A42439B1B6808E4008432A9 /* LGSideMenuControllerDemo.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 4A4243931B6808E4008432A9 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0640; + ORGANIZATIONNAME = "Grigory Lutkov"; + TargetAttributes = { + 4A42439A1B6808E4008432A9 = { + CreatedOnToolsVersion = 6.4; + }; + }; + }; + buildConfigurationList = 4A4243961B6808E4008432A9 /* Build configuration list for PBXProject "LGSideMenuControllerDemo" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 4A4243921B6808E4008432A9; + productRefGroup = 4A42439C1B6808E4008432A9 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 4A42439A1B6808E4008432A9 /* LGSideMenuControllerDemo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 4A4243991B6808E4008432A9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4ADAFC351B6903FF00B33211 /* image.png in Resources */, + 4ADAFC371B6903FF00B33211 /* image3.png in Resources */, + 4A4243AA1B6808E4008432A9 /* Main.storyboard in Resources */, + 4ADAFC361B6903FF00B33211 /* image2.png in Resources */, + 4A4243AC1B6808E4008432A9 /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + AEB5C6C3E6EE848EBB20B6C4 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + E2536D4655B09414CE15F03D /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-LGSideMenuControllerDemo/Pods-LGSideMenuControllerDemo-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 4A4243971B6808E4008432A9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4A4243A71B6808E4008432A9 /* ViewController.m in Sources */, + 4A4243A41B6808E4008432A9 /* AppDelegate.m in Sources */, + 4A4243A11B6808E4008432A9 /* main.m in Sources */, + 4ADAFC441B691DA500B33211 /* LeftViewController.m in Sources */, + 4ADAFC451B691DA500B33211 /* RightViewCell.m in Sources */, + 4ADAFC461B691DA500B33211 /* RightViewController.m in Sources */, + 4ADAFC431B691DA500B33211 /* LeftViewCell.m in Sources */, + 4ADAFC3A1B69190900B33211 /* MainViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 4A4243A81B6808E4008432A9 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 4A4243A91B6808E4008432A9 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 4A4243BC1B6808E4008432A9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 4A4243BD1B6808E4008432A9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 4A4243BF1B6808E4008432A9 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 848F56D8BFC1CBB7C8AF6C8B /* Pods-LGSideMenuControllerDemo.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + INFOPLIST_FILE = LGSideMenuControllerDemo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 4A4243C01B6808E4008432A9 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 1D786D515F2DB6D9D388116A /* Pods-LGSideMenuControllerDemo.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + INFOPLIST_FILE = LGSideMenuControllerDemo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 4A4243961B6808E4008432A9 /* Build configuration list for PBXProject "LGSideMenuControllerDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4A4243BC1B6808E4008432A9 /* Debug */, + 4A4243BD1B6808E4008432A9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4A4243BE1B6808E4008432A9 /* Build configuration list for PBXNativeTarget "LGSideMenuControllerDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4A4243BF1B6808E4008432A9 /* Debug */, + 4A4243C01B6808E4008432A9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 4A4243931B6808E4008432A9 /* Project object */; +} diff --git a/Demo Storyboard/LGSideMenuControllerDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Demo Storyboard/LGSideMenuControllerDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..bd94287 --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Demo Storyboard/LGSideMenuControllerDemo.xcworkspace/contents.xcworkspacedata b/Demo Storyboard/LGSideMenuControllerDemo.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..5bd882c --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Demo Storyboard/LGSideMenuControllerDemo/AppDelegate.h b/Demo Storyboard/LGSideMenuControllerDemo/AppDelegate.h new file mode 100644 index 0000000..0fa853c --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/AppDelegate.h @@ -0,0 +1,23 @@ +// +// AppDelegate.h +// LGSideMenuControllerDemo +// +// Created by Grigory Lutkov on 28.07.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import + +#warning CHOOSE TYPE 1 .. 5 + +#define TYPE 1 + +#define kMainViewController (MainViewController *)[[(AppDelegate *)[[UIApplication sharedApplication] delegate] window] rootViewController] +#define kNavigationController (UINavigationController *)[(MainViewController *)[[(AppDelegate *)[[UIApplication sharedApplication] delegate] window] rootViewController] rootViewController] + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end + diff --git a/Demo Storyboard/LGSideMenuControllerDemo/AppDelegate.m b/Demo Storyboard/LGSideMenuControllerDemo/AppDelegate.m new file mode 100644 index 0000000..ea281ac --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/AppDelegate.m @@ -0,0 +1,59 @@ +// +// AppDelegate.m +// LGSideMenuControllerDemo +// +// Created by Grigory Lutkov on 28.07.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + if ([UIDevice currentDevice].systemVersion.floatValue < 7.0) + application.statusBarStyle = UIStatusBarStyleBlackOpaque; + + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application +{ + // 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. + // 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. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application +{ + // 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. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application +{ + // 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. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application +{ + // 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. +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + +#pragma mark - + +- (void)application:(UIApplication *)application didChangeStatusBarOrientation:(UIInterfaceOrientation)oldStatusBarOrientation +{ + application.statusBarHidden = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone && UIInterfaceOrientationIsLandscape(application.statusBarOrientation)); +} + +@end diff --git a/Demo Storyboard/LGSideMenuControllerDemo/Base.lproj/Main.storyboard b/Demo Storyboard/LGSideMenuControllerDemo/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f6ab0fa --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/Base.lproj/Main.storyboard @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/AppIcon.appiconset/Contents.json b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..c5fda8e --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,9 @@ +{ + "images" : [ + + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Contents.json b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..9da5e8e --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,134 @@ +{ + "images" : [ + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "736h", + "filename" : "Launch-Phone-55-P@3x.png", + "minimum-system-version" : "8.0", + "orientation" : "portrait", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "736h", + "filename" : "Launch-Phone-55-L@3x.png", + "minimum-system-version" : "8.0", + "orientation" : "landscape", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "667h", + "filename" : "Launch-Phone-47-P@2x.png", + "minimum-system-version" : "8.0", + "orientation" : "portrait", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "filename" : "Launch-Phone-35-P@2x.png", + "scale" : "2x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "retina4", + "filename" : "Launch-Phone-40-P@2x.png", + "minimum-system-version" : "7.0", + "orientation" : "portrait", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "filename" : "Launch-Pad-P@1x.png", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "filename" : "Launch-Pad-L@1x.png", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "filename" : "Launch-Pad-P@2x.png", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "filename" : "Launch-Pad-L@2x.png", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "filename" : "Launch-Phone-35-P@1x.png", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "filename" : "Launch-Phone-35-P@2x.png", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "filename" : "Launch-Phone-40-P@2x.png", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "filename" : "Launch-Pad-P@1x.png", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "filename" : "Launch-Pad-L@1x.png", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "filename" : "Launch-Pad-P@2x.png", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "filename" : "Launch-Pad-L@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Pad-L@1x.png b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Pad-L@1x.png new file mode 100644 index 0000000..67c9e1d Binary files /dev/null and b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Pad-L@1x.png differ diff --git a/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Pad-L@2x.png b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Pad-L@2x.png new file mode 100644 index 0000000..2ce1e95 Binary files /dev/null and b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Pad-L@2x.png differ diff --git a/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Pad-P@1x.png b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Pad-P@1x.png new file mode 100644 index 0000000..369ade2 Binary files /dev/null and b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Pad-P@1x.png differ diff --git a/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Pad-P@2x.png b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Pad-P@2x.png new file mode 100644 index 0000000..d379a54 Binary files /dev/null and b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Pad-P@2x.png differ diff --git a/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-35-P@1x.png b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-35-P@1x.png new file mode 100644 index 0000000..107999c Binary files /dev/null and b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-35-P@1x.png differ diff --git a/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-35-P@2x.png b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-35-P@2x.png new file mode 100644 index 0000000..b69f17f Binary files /dev/null and b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-35-P@2x.png differ diff --git a/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-40-P@2x.png b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-40-P@2x.png new file mode 100644 index 0000000..6258ece Binary files /dev/null and b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-40-P@2x.png differ diff --git a/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-47-P@2x.png b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-47-P@2x.png new file mode 100644 index 0000000..c257d16 Binary files /dev/null and b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-47-P@2x.png differ diff --git a/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-55-L@3x.png b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-55-L@3x.png new file mode 100644 index 0000000..34ec1ed Binary files /dev/null and b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-55-L@3x.png differ diff --git a/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-55-P@3x.png b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-55-P@3x.png new file mode 100644 index 0000000..1b08e31 Binary files /dev/null and b/Demo Storyboard/LGSideMenuControllerDemo/Images.xcassets/LaunchImage.launchimage/Launch-Phone-55-P@3x.png differ diff --git a/Demo Storyboard/LGSideMenuControllerDemo/Info.plist b/Demo Storyboard/LGSideMenuControllerDemo/Info.plist new file mode 100644 index 0000000..56b7404 --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.test.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/Demo Storyboard/LGSideMenuControllerDemo/LeftViewCell.h b/Demo Storyboard/LGSideMenuControllerDemo/LeftViewCell.h new file mode 100644 index 0000000..f2c3943 --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/LeftViewCell.h @@ -0,0 +1,16 @@ +// +// LeftViewCell.h +// LGSideMenuControllerDemo +// +// Created by Friend_LGA on 26.04.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import + +@interface LeftViewCell : UITableViewCell + +@property (strong, nonatomic) UIView *separatorView; +@property (strong, nonatomic) UIColor *tintColor; + +@end diff --git a/Demo Storyboard/LGSideMenuControllerDemo/LeftViewCell.m b/Demo Storyboard/LGSideMenuControllerDemo/LeftViewCell.m new file mode 100644 index 0000000..d7b4d07 --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/LeftViewCell.m @@ -0,0 +1,53 @@ +// +// LeftViewCell.m +// LGSideMenuControllerDemo +// +// Created by Friend_LGA on 26.04.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import "LeftViewCell.h" + +@interface LeftViewCell () + +@end + +@implementation LeftViewCell + +- (void)awakeFromNib +{ + [super awakeFromNib]; + + self.selectionStyle = UITableViewCellSelectionStyleNone; + + self.backgroundColor = [UIColor clearColor]; + + self.textLabel.font = [UIFont boldSystemFontOfSize:16.f]; + + // ----- + + _separatorView = [UIView new]; + [self addSubview:_separatorView]; +} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + + self.textLabel.textColor = _tintColor; + _separatorView.backgroundColor = [_tintColor colorWithAlphaComponent:0.4]; + + CGFloat height = ([UIScreen mainScreen].scale == 1.f ? 1.f : 0.5); + + _separatorView.frame = CGRectMake(0.f, self.frame.size.height-height, self.frame.size.width*0.9, height); +} + +- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated +{ + if (highlighted) + self.textLabel.textColor = [UIColor colorWithRed:0.f green:0.5 blue:1.f alpha:1.f]; + else + self.textLabel.textColor = _tintColor; +} + +@end diff --git a/Demo Storyboard/LGSideMenuControllerDemo/LeftViewController.h b/Demo Storyboard/LGSideMenuControllerDemo/LeftViewController.h new file mode 100644 index 0000000..6683adb --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/LeftViewController.h @@ -0,0 +1,15 @@ +// +// LeftViewController.h +// LGSideMenuControllerDemo +// +// Created by Grigory Lutkov on 18.02.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import + +@interface LeftViewController : UITableViewController + +@property (strong, nonatomic) UIColor *tintColor; + +@end diff --git a/Demo Storyboard/LGSideMenuControllerDemo/LeftViewController.m b/Demo Storyboard/LGSideMenuControllerDemo/LeftViewController.m new file mode 100644 index 0000000..c75f045 --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/LeftViewController.m @@ -0,0 +1,120 @@ +// +// LeftViewController.m +// LGSideMenuControllerDemo +// +// Created by Grigory Lutkov on 18.02.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import "LeftViewController.h" +#import "MainViewController.h" +#import "AppDelegate.h" +#import "LeftViewCell.h" +#import "ViewController.h" + +@interface LeftViewController () + +@property (strong, nonatomic) NSArray *titlesArray; + +@end + +@implementation LeftViewController + +- (void)awakeFromNib +{ + [super awakeFromNib]; + + _titlesArray = @[@"Set View Controllers", + @"Open Right View", + @"", + @"Profile", + @"News", + @"Articles", + @"Video", + @"Music"]; + + self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + self.tableView.contentInset = UIEdgeInsetsMake(20.f, 0.f, 20.f, 0.f); + self.tableView.showsVerticalScrollIndicator = NO; +} + +#pragma mark - + +- (void)openLeftView +{ + [kMainViewController showLeftViewAnimated:YES completionHandler:nil]; +} + +- (void)openRightView +{ + [kMainViewController showRightViewAnimated:YES completionHandler:nil]; +} + +#pragma mark - UITableView DataSource + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return _titlesArray.count; +} + +#pragma mark - UITableView Delegate + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + LeftViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; + + cell.textLabel.text = _titlesArray[indexPath.row]; + cell.separatorView.hidden = !(indexPath.row != _titlesArray.count-1 && indexPath.row != 1 && indexPath.row != 2); + cell.userInteractionEnabled = (indexPath.row != 2); + + cell.tintColor = _tintColor; + + return cell; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (indexPath.row == 2) return 22.f; + else return 44.f; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (indexPath.row == 0) + { + ViewController *viewController = [kNavigationController viewControllers].firstObject; + + UIViewController *viewController2 = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController"]; + viewController2.title = @"Test"; + + [kNavigationController setViewControllers:@[viewController, viewController2]]; + + [kMainViewController hideLeftViewAnimated:YES completionHandler:nil]; + } + else if (indexPath.row == 1) + { + if (![kMainViewController isLeftViewAlwaysVisible]) + { + [kMainViewController hideLeftViewAnimated:YES completionHandler:^(void) + { + [kMainViewController showRightViewAnimated:YES completionHandler:nil]; + }]; + } + else [kMainViewController showRightViewAnimated:YES completionHandler:nil]; + } + else + { + UIViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController"]; + viewController.title = _titlesArray[indexPath.row]; + [kNavigationController pushViewController:viewController animated:YES]; + + [kMainViewController hideLeftViewAnimated:YES completionHandler:nil]; + } +} + +@end diff --git a/Demo Storyboard/LGSideMenuControllerDemo/MainViewController.h b/Demo Storyboard/LGSideMenuControllerDemo/MainViewController.h new file mode 100644 index 0000000..a94c560 --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/MainViewController.h @@ -0,0 +1,13 @@ +// +// MainViewController.h +// LGSideMenuControllerDemo +// +// Created by Grigory Lutkov on 25.04.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import "LGSideMenuController.h" + +@interface MainViewController : LGSideMenuController + +@end diff --git a/Demo Storyboard/LGSideMenuControllerDemo/MainViewController.m b/Demo Storyboard/LGSideMenuControllerDemo/MainViewController.m new file mode 100644 index 0000000..ea2ab9c --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/MainViewController.m @@ -0,0 +1,241 @@ +// +// MainViewController.m +// LGSideMenuControllerDemo +// +// Created by Grigory Lutkov on 25.04.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import "MainViewController.h" +#import "ViewController.h" +#import "LeftViewController.h" +#import "RightViewController.h" +#import "AppDelegate.h" + +@interface MainViewController () + +@property (strong, nonatomic) LeftViewController *leftViewController; +@property (strong, nonatomic) RightViewController *rightViewController; + +@end + +@implementation MainViewController + +- (void)awakeFromNib +{ + [super awakeFromNib]; + + self.view.backgroundColor = [UIColor whiteColor]; + + self.rootViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"NavigationController"]; + _leftViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"LeftViewController"]; + _rightViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"RightViewController"]; + + // ----- + + if (TYPE == 1) + { + [self setLeftViewEnabledWithWidth:250.f + presentationStyle:LGSideMenuPresentationStyleScaleFromBig + alwaysVisibleOptions:0]; + + self.leftViewBackgroundImage = [UIImage imageNamed:@"image"]; + + // ----- + + [self setRightViewEnabledWithWidth:100.f + presentationStyle:LGSideMenuPresentationStyleScaleFromBig + alwaysVisibleOptions:0]; + + self.rightViewBackgroundImage = [UIImage imageNamed:@"image2"]; + + // ----- + + _leftViewController.tableView.backgroundColor = [UIColor clearColor]; + _leftViewController.tintColor = [UIColor whiteColor]; + [_leftViewController.tableView reloadData]; + [self.leftView addSubview:_leftViewController.tableView]; + + // ----- + + _rightViewController.tableView.backgroundColor = [UIColor clearColor]; + _rightViewController.tintColor = [UIColor whiteColor]; + [_rightViewController.tableView reloadData]; + [self.rightView addSubview:_rightViewController.tableView]; + } + else if (TYPE == 2) + { + [self setLeftViewEnabledWithWidth:250.f + presentationStyle:LGSideMenuPresentationStyleSlideAbove + alwaysVisibleOptions:0]; + + self.leftViewBackgroundColor = [UIColor colorWithWhite:1.f alpha:0.9]; + + // ----- + + [self setRightViewEnabledWithWidth:100.f + presentationStyle:LGSideMenuPresentationStyleSlideAbove + alwaysVisibleOptions:0]; + + self.rightViewBackgroundColor = [UIColor colorWithWhite:1.f alpha:0.9]; + + // ----- + + _leftViewController.tableView.backgroundColor = [UIColor clearColor]; + _leftViewController.tintColor = [UIColor blackColor]; + [_leftViewController.tableView reloadData]; + [self.leftView addSubview:_leftViewController.tableView]; + + // ----- + + _rightViewController.tableView.backgroundColor = [UIColor clearColor]; + _rightViewController.tintColor = [UIColor blackColor]; + [_rightViewController.tableView reloadData]; + [self.rightView addSubview:_rightViewController.tableView]; + } + else if (TYPE == 3) + { + [self setLeftViewEnabledWithWidth:250.f + presentationStyle:LGSideMenuPresentationStyleSlideBelow + alwaysVisibleOptions:0]; + + self.leftViewBackgroundImage = [UIImage imageNamed:@"image"]; + + // ----- + + [self setRightViewEnabledWithWidth:100.f + presentationStyle:LGSideMenuPresentationStyleSlideBelow + alwaysVisibleOptions:0]; + + self.rightViewBackgroundImage = [UIImage imageNamed:@"image2"]; + + // ----- + + _leftViewController.tableView.backgroundColor = [UIColor clearColor]; + _leftViewController.tintColor = [UIColor whiteColor]; + [_leftViewController.tableView reloadData]; + [self.leftView addSubview:_leftViewController.tableView]; + + // ----- + + _rightViewController.tableView.backgroundColor = [UIColor clearColor]; + _rightViewController.tintColor = [UIColor whiteColor]; + [_rightViewController.tableView reloadData]; + [self.rightView addSubview:_rightViewController.tableView]; + } + else if (TYPE == 4) + { + [self setLeftViewEnabledWithWidth:200.f + presentationStyle:LGSideMenuPresentationStyleScaleFromLittle + alwaysVisibleOptions:LGSideMenuAlwaysVisibleOnPadLandscape|LGSideMenuAlwaysVisibleOnPhoneLandscape]; + + self.leftViewBackgroundImage = [UIImage imageNamed:@"image"]; + self.leftViewStatusBarVisibleOptions = LGSideMenuStatusBarVisibleOnPadLandscape; + + // ----- + + [self setRightViewEnabledWithWidth:100.f + presentationStyle:LGSideMenuPresentationStyleSlideAbove + alwaysVisibleOptions:0]; + + self.rightViewBackgroundColor = [UIColor colorWithWhite:1.f alpha:0.9]; + self.rightViewStatusBarVisibleOptions = LGSideMenuStatusBarVisibleOnPadLandscape; + + // ----- + + _leftViewController.tableView.backgroundColor = [UIColor clearColor]; + _leftViewController.tintColor = [UIColor whiteColor]; + [_leftViewController.tableView reloadData]; + [self.leftView addSubview:_leftViewController.tableView]; + + // ----- + + _rightViewController.tableView.backgroundColor = [UIColor clearColor]; + _rightViewController.tintColor = [UIColor blackColor]; + [_rightViewController.tableView reloadData]; + [self.rightView addSubview:_rightViewController.tableView]; + } + else if (TYPE == 5) + { + [self setLeftViewEnabledWithWidth:200.f + presentationStyle:LGSideMenuPresentationStyleScaleFromBig + alwaysVisibleOptions:LGSideMenuAlwaysVisibleOnPadLandscape|LGSideMenuAlwaysVisibleOnPhoneLandscape]; + + self.leftViewBackgroundImage = [UIImage imageNamed:@"image"]; + self.leftViewStatusBarVisibleOptions = LGSideMenuStatusBarVisibleOnPadLandscape; + self.leftViewBackgroundImageInitialScale = 1.5; + self.leftViewInititialOffsetX = -200.f; + self.leftViewInititialScale = 1.5; + + self.rootViewCoverColorForLeftView = [UIColor colorWithRed:0.f green:1.f blue:0.5 alpha:0.3]; + self.rootViewScaleForLeftView = 0.6; + self.rootViewLayerBorderWidth = 3.f; + self.rootViewLayerBorderColor = [UIColor whiteColor]; + self.rootViewLayerShadowRadius = 10.f; + + // ----- + + [self setRightViewEnabledWithWidth:100.f + presentationStyle:LGSideMenuPresentationStyleSlideAbove + alwaysVisibleOptions:LGSideMenuAlwaysVisibleOnPadLandscape|LGSideMenuAlwaysVisibleOnPhoneLandscape]; + + self.rightViewBackgroundColor = [UIColor colorWithWhite:1.f alpha:0.7]; + self.rightViewStatusBarVisibleOptions = LGSideMenuStatusBarVisibleOnPadLandscape; + self.rightViewLayerBorderWidth = 3.f; + self.rightViewLayerBorderColor = [UIColor blackColor]; + self.rightViewLayerShadowRadius = 10.f; + + self.rootViewCoverColorForRightView = [UIColor colorWithRed:0.f green:0.5 blue:1.f alpha:0.3]; + + // ----- + + _leftViewController.tableView.backgroundColor = [UIColor clearColor]; + _leftViewController.tintColor = [UIColor whiteColor]; + [_leftViewController.tableView reloadData]; + [self.leftView addSubview:_leftViewController.tableView]; + + // ----- + + _rightViewController.tableView.backgroundColor = [UIColor clearColor]; + _rightViewController.tintColor = [UIColor blackColor]; + [_rightViewController.tableView reloadData]; + [self.rightView addSubview:_rightViewController.tableView]; + } +} + +- (void)leftViewWillLayoutSubviewsWithSize:(CGSize)size +{ + [super leftViewWillLayoutSubviewsWithSize:size]; + + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad && (TYPE == 4 || TYPE == 5)) + { + if (self.isLeftViewAlwaysVisible) + { + _leftViewController.tableView.frame = CGRectMake(0.f , 20.f, size.width, size.height-20.f); + _leftViewController.tableView.contentInset = UIEdgeInsetsMake(0.f, 0.f, 20.f, 0.f); + } + else + { + _leftViewController.tableView.frame = CGRectMake(0.f , 0.f, size.width, size.height); + _leftViewController.tableView.contentInset = UIEdgeInsetsMake(20.f, 0.f, 20.f, 0.f); + } + } + else _leftViewController.tableView.frame = CGRectMake(0.f , 0.f, size.width, size.height); +} + +- (void)rightViewWillLayoutSubviewsWithSize:(CGSize)size +{ + [super rightViewWillLayoutSubviewsWithSize:size]; + + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad && (TYPE == 4 || TYPE == 5)) + { + if (self.isLeftViewAlwaysVisible) + _rightViewController.tableView.frame = CGRectMake(0.f , 20.f, size.width, size.height-20.f); + else + _rightViewController.tableView.frame = CGRectMake(0.f , 0.f, size.width, size.height); + } + else _rightViewController.tableView.frame = CGRectMake(0.f , 0.f, size.width, size.height); +} + + +@end diff --git a/Demo Storyboard/LGSideMenuControllerDemo/RightViewCell.h b/Demo Storyboard/LGSideMenuControllerDemo/RightViewCell.h new file mode 100644 index 0000000..72f77ed --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/RightViewCell.h @@ -0,0 +1,16 @@ +// +// RightViewCell.h +// LGSideMenuControllerDemo +// +// Created by Grigory Lutkov on 26.04.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import + +@interface RightViewCell : UITableViewCell + +@property (strong, nonatomic) UIView *separatorView; +@property (strong, nonatomic) UIColor *tintColor; + +@end diff --git a/Demo Storyboard/LGSideMenuControllerDemo/RightViewCell.m b/Demo Storyboard/LGSideMenuControllerDemo/RightViewCell.m new file mode 100644 index 0000000..143dc6f --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/RightViewCell.m @@ -0,0 +1,55 @@ +// +// RightViewCell.m +// LGSideMenuControllerDemo +// +// Created by Grigory Lutkov on 26.04.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import "RightViewCell.h" + +@interface RightViewCell () + +@end + +@implementation RightViewCell + +- (void)awakeFromNib +{ + [super awakeFromNib]; + + self.selectionStyle = UITableViewCellSelectionStyleNone; + + self.backgroundColor = [UIColor clearColor]; + + self.textLabel.textAlignment = NSTextAlignmentCenter; + self.textLabel.numberOfLines = 0; + self.textLabel.lineBreakMode = NSLineBreakByWordWrapping; + + // ----- + + _separatorView = [UIView new]; + [self addSubview:_separatorView]; +} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + + self.textLabel.textColor = _tintColor; + _separatorView.backgroundColor = [_tintColor colorWithAlphaComponent:0.4]; + + CGFloat height = ([UIScreen mainScreen].scale == 1.f ? 1.f : 0.5); + + _separatorView.frame = CGRectMake(self.frame.size.width*0.1, self.frame.size.height-height, self.frame.size.width*0.9, height); +} + +- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated +{ + if (highlighted) + self.textLabel.textColor = [UIColor colorWithRed:0.f green:0.5 blue:1.f alpha:1.f]; + else + self.textLabel.textColor = _tintColor; +} + +@end diff --git a/Demo Storyboard/LGSideMenuControllerDemo/RightViewController.h b/Demo Storyboard/LGSideMenuControllerDemo/RightViewController.h new file mode 100644 index 0000000..45d390b --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/RightViewController.h @@ -0,0 +1,15 @@ +// +// RightViewController.h +// LGSideMenuControllerDemo +// +// Created by Grigory Lutkov on 18.02.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import + +@interface RightViewController : UITableViewController + +@property (strong, nonatomic) UIColor *tintColor; + +@end diff --git a/Demo Storyboard/LGSideMenuControllerDemo/RightViewController.m b/Demo Storyboard/LGSideMenuControllerDemo/RightViewController.m new file mode 100644 index 0000000..8c39684 --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/RightViewController.m @@ -0,0 +1,128 @@ +// +// RightViewController.m +// LGSideMenuControllerDemo +// +// Created by Grigory Lutkov on 18.02.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import "RightViewController.h" +#import "MainViewController.h" +#import "AppDelegate.h" +#import "RightViewCell.h" +#import "ViewController.h" + +@interface RightViewController () + +@property (strong, nonatomic) NSArray *titlesArray; + +@end + +@implementation RightViewController + +- (void)awakeFromNib +{ + [super awakeFromNib]; + + _titlesArray = @[@"Set VC", + @"Open Left View", + @"", + @"1", + @"2", + @"3", + @"4", + @"5", + @"6", + @"7", + @"8", + @"9", + @"10"]; + + self.tableView.separatorStyle = UITableViewCellSelectionStyleNone; + self.tableView.showsVerticalScrollIndicator = NO; +} + +#pragma mark - + +- (void)openLeftView +{ + [kMainViewController showLeftViewAnimated:YES completionHandler:nil]; +} + +- (void)openRightView +{ + [kMainViewController showRightViewAnimated:YES completionHandler:nil]; +} + +#pragma mark - UITableView DataSource + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return _titlesArray.count; +} + +#pragma mark - UITableView Delegate + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + RightViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; + + cell.textLabel.text = _titlesArray[indexPath.row]; + if (indexPath.row < 3) + cell.textLabel.font = [UIFont boldSystemFontOfSize:15.f]; + else + cell.textLabel.font = [UIFont boldSystemFontOfSize:30.f]; + cell.separatorView.hidden = !(indexPath.row != _titlesArray.count-1 && indexPath.row != 1 && indexPath.row != 2); + cell.userInteractionEnabled = (indexPath.row != 2); + + cell.tintColor = _tintColor; + + return cell; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (indexPath.row == 2) return 50.f; + else return 100.f; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (indexPath.row == 0) + { + ViewController *viewController = [kNavigationController viewControllers].firstObject; + + UIViewController *viewController2 = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController"]; + viewController2.title = @"Test"; + + [kNavigationController setViewControllers:@[viewController, viewController2]]; + + [kMainViewController hideRightViewAnimated:YES completionHandler:nil]; + } + else if (indexPath.row == 1) + { + if (![kMainViewController isRightViewAlwaysVisible]) + { + [kMainViewController hideRightViewAnimated:YES completionHandler:^(void) + { + [kMainViewController showLeftViewAnimated:YES completionHandler:nil]; + }]; + } + else [kMainViewController showLeftViewAnimated:YES completionHandler:nil]; + } + else + { + UIViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController"]; + viewController.title = [NSString stringWithFormat:@"Test %@", _titlesArray[indexPath.row]]; + [kNavigationController pushViewController:viewController animated:YES]; + + [kMainViewController hideRightViewAnimated:YES completionHandler:nil]; + } +} + +@end diff --git a/Demo Storyboard/LGSideMenuControllerDemo/ViewController.h b/Demo Storyboard/LGSideMenuControllerDemo/ViewController.h new file mode 100644 index 0000000..2ce1c26 --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// LGSideMenuControllerDemo +// +// Created by Grigory Lutkov on 18.02.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/Demo Storyboard/LGSideMenuControllerDemo/ViewController.m b/Demo Storyboard/LGSideMenuControllerDemo/ViewController.m new file mode 100644 index 0000000..d55d412 --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/ViewController.m @@ -0,0 +1,114 @@ +// +// ViewController.m +// LGSideMenuControllerDemo +// +// Created by Grigory Lutkov on 18.02.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import "ViewController.h" +#import "MainViewController.h" +#import "AppDelegate.h" + +@interface ViewController () + +@property (strong, nonatomic) UIImageView *imageView; +@property (strong, nonatomic) UIButton *button; + +@end + +@implementation ViewController + +- (void)awakeFromNib +{ + self.title = @"LGSideMenuController"; + + self.view.backgroundColor = [UIColor whiteColor]; + + // ----- + + _imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image3"]]; + _imageView.contentMode = UIViewContentModeScaleAspectFill; + [self.view addSubview:_imageView]; + + _button = [UIButton new]; + _button.backgroundColor = [UIColor colorWithWhite:1.f alpha:0.5]; + [_button setTitle:@"Push View Controller" forState:UIControlStateNormal]; + [_button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; + [_button setTitleColor:[UIColor colorWithRed:0.f green:0.5 blue:1.f alpha:1.f] forState:UIControlStateHighlighted]; + [_button addTarget:self action:@selector(pushViewControllerAction) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:_button]; + + // ----- + + [self checkNavItemButtonsWithInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation]; +} + +- (void)viewWillLayoutSubviews +{ + [super viewWillLayoutSubviews]; + + _imageView.frame = CGRectMake(0.f, 0.f, self.view.frame.size.width, self.view.frame.size.height); + + _button.frame = CGRectMake(0.f, self.view.frame.size.height-44.f, self.view.frame.size.width, 44.f); +} + +#pragma mark - + +- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator +{ + [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; + + UIInterfaceOrientation interfaceOrientation = (size.width < size.height ? UIInterfaceOrientationPortrait : UIInterfaceOrientationLandscapeLeft); + + [self checkNavItemButtonsWithInterfaceOrientation:interfaceOrientation]; +} + +- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration +{ + [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; + + [self checkNavItemButtonsWithInterfaceOrientation:toInterfaceOrientation]; +} + +- (void)checkNavItemButtonsWithInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + if (TYPE == 4 || TYPE == 5) + { + if ([kMainViewController isLeftViewAlwaysVisibleForInterfaceOrientation:interfaceOrientation]) + self.navigationItem.leftBarButtonItem = nil; + else + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Left" style:UIBarButtonItemStylePlain target:self action:@selector(openLeftView)]; + + if ([kMainViewController isRightViewAlwaysVisibleForInterfaceOrientation:interfaceOrientation]) + self.navigationItem.rightBarButtonItem = nil; + else + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Right" style:UIBarButtonItemStylePlain target:self action:@selector(openRightView)]; + } + else + { + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Left" style:UIBarButtonItemStylePlain target:self action:@selector(openLeftView)]; + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Right" style:UIBarButtonItemStylePlain target:self action:@selector(openRightView)]; + } +} + +#pragma mark - + +- (void)openLeftView +{ + [kMainViewController showLeftViewAnimated:YES completionHandler:nil]; +} + +- (void)openRightView +{ + [kMainViewController showRightViewAnimated:YES completionHandler:nil]; +} + +- (void)pushViewControllerAction +{ + UIViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController"]; + viewController.title = @"Test"; + [kNavigationController pushViewController:viewController animated:YES]; +} + +@end diff --git a/Demo/LGSideMenuControllerDemo/Image.png b/Demo Storyboard/LGSideMenuControllerDemo/image.png similarity index 100% rename from Demo/LGSideMenuControllerDemo/Image.png rename to Demo Storyboard/LGSideMenuControllerDemo/image.png diff --git a/Demo Storyboard/LGSideMenuControllerDemo/image2.png b/Demo Storyboard/LGSideMenuControllerDemo/image2.png new file mode 100644 index 0000000..1b8ac6a Binary files /dev/null and b/Demo Storyboard/LGSideMenuControllerDemo/image2.png differ diff --git a/Demo Storyboard/LGSideMenuControllerDemo/image3.png b/Demo Storyboard/LGSideMenuControllerDemo/image3.png new file mode 100644 index 0000000..5fdcbbf Binary files /dev/null and b/Demo Storyboard/LGSideMenuControllerDemo/image3.png differ diff --git a/Demo Storyboard/LGSideMenuControllerDemo/main.m b/Demo Storyboard/LGSideMenuControllerDemo/main.m new file mode 100644 index 0000000..22b58d7 --- /dev/null +++ b/Demo Storyboard/LGSideMenuControllerDemo/main.m @@ -0,0 +1,16 @@ +// +// main.m +// LGSideMenuControllerDemo +// +// Created by Friend_LGA on 28.07.15. +// Copyright (c) 2015 Grigory Lutkov. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/Demo Storyboard/Podfile b/Demo Storyboard/Podfile new file mode 100644 index 0000000..7714046 --- /dev/null +++ b/Demo Storyboard/Podfile @@ -0,0 +1,10 @@ +source 'https://github.com/CocoaPods/Specs.git' + +platform :ios, '6.0' +inhibit_all_warnings! + +xcodeproj 'LGSideMenuControllerDemo' + +target 'LGSideMenuControllerDemo' do + pod 'LGSideMenuController', :path => '../' +end diff --git a/Demo Storyboard/Podfile.lock b/Demo Storyboard/Podfile.lock new file mode 100644 index 0000000..7d2c16f --- /dev/null +++ b/Demo Storyboard/Podfile.lock @@ -0,0 +1,14 @@ +PODS: + - LGSideMenuController (1.0.2) + +DEPENDENCIES: + - LGSideMenuController (from `../`) + +EXTERNAL SOURCES: + LGSideMenuController: + :path: ../ + +SPEC CHECKSUMS: + LGSideMenuController: e3105c0fe8ef68475fd4d8695913c0bcb8759630 + +COCOAPODS: 0.38.2 diff --git a/Demo Storyboard/podsInstall.command b/Demo Storyboard/podsInstall.command new file mode 100644 index 0000000..3c76888 --- /dev/null +++ b/Demo Storyboard/podsInstall.command @@ -0,0 +1,5 @@ +#!/bin/sh + +cd "$(dirname "$0")" + +pod install diff --git a/Demo Storyboard/podsUpdate.command b/Demo Storyboard/podsUpdate.command new file mode 100644 index 0000000..f48a821 --- /dev/null +++ b/Demo Storyboard/podsUpdate.command @@ -0,0 +1,5 @@ +#!/bin/sh + +cd "$(dirname "$0")" + +pod update diff --git a/Demo/LGSideMenuControllerDemo.xcodeproj/project.pbxproj b/Demo/LGSideMenuControllerDemo.xcodeproj/project.pbxproj index 812602f..2762560 100644 --- a/Demo/LGSideMenuControllerDemo.xcodeproj/project.pbxproj +++ b/Demo/LGSideMenuControllerDemo.xcodeproj/project.pbxproj @@ -19,7 +19,7 @@ 4A5888E31AE94907004AFC57 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A5888E11AE94907004AFC57 /* ViewController.m */; }; 4A645CDE1B02797300FFBDF6 /* image3.png in Resources */ = {isa = PBXBuildFile; fileRef = 4A645CDD1B02797300FFBDF6 /* image3.png */; }; 4A66FCA01AEBC443005B8B0A /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A66FC9F1AEBC443005B8B0A /* MainViewController.m */; }; - 4A6FE4F51AFBDBD2003887C9 /* Image.png in Resources */ = {isa = PBXBuildFile; fileRef = 4A6FE4F41AFBDBD2003887C9 /* Image.png */; }; + 4A6FE4F51AFBDBD2003887C9 /* image.png in Resources */ = {isa = PBXBuildFile; fileRef = 4A6FE4F41AFBDBD2003887C9 /* image.png */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -43,7 +43,7 @@ 4A645CDD1B02797300FFBDF6 /* image3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = image3.png; sourceTree = ""; }; 4A66FC9E1AEBC443005B8B0A /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; 4A66FC9F1AEBC443005B8B0A /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; - 4A6FE4F41AFBDBD2003887C9 /* Image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Image.png; sourceTree = ""; }; + 4A6FE4F41AFBDBD2003887C9 /* image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = image.png; sourceTree = ""; }; 5361F993C972042479CAE21E /* Pods-LGSideMenuControllerDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LGSideMenuControllerDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-LGSideMenuControllerDemo/Pods-LGSideMenuControllerDemo.release.xcconfig"; sourceTree = ""; }; 78C2B1655760BC5BF67D9AD0 /* Pods-LGSideMenuControllerDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LGSideMenuControllerDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LGSideMenuControllerDemo/Pods-LGSideMenuControllerDemo.debug.xcconfig"; sourceTree = ""; }; F8C0B3D6B7FC45F42B6E52E2 /* libPods-LGSideMenuControllerDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-LGSideMenuControllerDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -133,7 +133,7 @@ children = ( 4A645CDD1B02797300FFBDF6 /* image3.png */, 4A339C421AFD3D6600F75B99 /* image2.png */, - 4A6FE4F41AFBDBD2003887C9 /* Image.png */, + 4A6FE4F41AFBDBD2003887C9 /* image.png */, ); name = Resources; sourceTree = ""; @@ -215,7 +215,7 @@ buildActionMask = 2147483647; files = ( 4A5888C61AE9489E004AFC57 /* Images.xcassets in Resources */, - 4A6FE4F51AFBDBD2003887C9 /* Image.png in Resources */, + 4A6FE4F51AFBDBD2003887C9 /* image.png in Resources */, 4A339C431AFD3D6600F75B99 /* image2.png in Resources */, 4A645CDE1B02797300FFBDF6 /* image3.png in Resources */, ); diff --git a/Demo/LGSideMenuControllerDemo/AppDelegate.h b/Demo/LGSideMenuControllerDemo/AppDelegate.h index 799860c..d8035e9 100644 --- a/Demo/LGSideMenuControllerDemo/AppDelegate.h +++ b/Demo/LGSideMenuControllerDemo/AppDelegate.h @@ -11,7 +11,7 @@ #warning CHOOSE TYPE 1 .. 5 -#define TYPE 3 +#define TYPE 1 #define kMainViewController [(AppDelegate *)[[UIApplication sharedApplication] delegate] mainViewController] #define kNavigationController (UINavigationController *)[[(AppDelegate *)[[UIApplication sharedApplication] delegate] mainViewController] rootViewController] diff --git a/Demo/LGSideMenuControllerDemo/MainViewController.m b/Demo/LGSideMenuControllerDemo/MainViewController.m index 5bf25b1..101987a 100644 --- a/Demo/LGSideMenuControllerDemo/MainViewController.m +++ b/Demo/LGSideMenuControllerDemo/MainViewController.m @@ -27,6 +27,9 @@ - (id)initWithRootViewController:(UIViewController *)rootViewController if (self) { self.view.backgroundColor = [UIColor whiteColor]; + + _leftViewController = [LeftViewController new]; + _rightViewController = [RightViewController new]; // ----- @@ -36,7 +39,7 @@ - (id)initWithRootViewController:(UIViewController *)rootViewController presentationStyle:LGSideMenuPresentationStyleScaleFromBig alwaysVisibleOptions:0]; - self.leftViewBackgroundImage = [UIImage imageNamed:@"Image"]; + self.leftViewBackgroundImage = [UIImage imageNamed:@"image"]; // ----- @@ -44,24 +47,20 @@ - (id)initWithRootViewController:(UIViewController *)rootViewController presentationStyle:LGSideMenuPresentationStyleScaleFromBig alwaysVisibleOptions:0]; - self.rightViewBackgroundImage = [UIImage imageNamed:@"Image2"]; + self.rightViewBackgroundImage = [UIImage imageNamed:@"image2"]; // ----- - _leftViewController = [LeftViewController new]; _leftViewController.tableView.backgroundColor = [UIColor clearColor]; _leftViewController.tintColor = [UIColor whiteColor]; [_leftViewController.tableView reloadData]; - [self.leftView addSubview:_leftViewController.tableView]; // ----- - _rightViewController = [RightViewController new]; _rightViewController.tableView.backgroundColor = [UIColor clearColor]; _rightViewController.tintColor = [UIColor whiteColor]; [_rightViewController.tableView reloadData]; - [self.rightView addSubview:_rightViewController.tableView]; } else if (TYPE == 2) @@ -82,20 +81,16 @@ - (id)initWithRootViewController:(UIViewController *)rootViewController // ----- - _leftViewController = [LeftViewController new]; _leftViewController.tableView.backgroundColor = [UIColor clearColor]; _leftViewController.tintColor = [UIColor blackColor]; [_leftViewController.tableView reloadData]; - [self.leftView addSubview:_leftViewController.tableView]; // ----- - _rightViewController = [RightViewController new]; _rightViewController.tableView.backgroundColor = [UIColor clearColor]; _rightViewController.tintColor = [UIColor blackColor]; [_rightViewController.tableView reloadData]; - [self.rightView addSubview:_rightViewController.tableView]; } else if (TYPE == 3) @@ -104,7 +99,7 @@ - (id)initWithRootViewController:(UIViewController *)rootViewController presentationStyle:LGSideMenuPresentationStyleSlideBelow alwaysVisibleOptions:0]; - self.leftViewBackgroundImage = [UIImage imageNamed:@"Image"]; + self.leftViewBackgroundImage = [UIImage imageNamed:@"image"]; // ----- @@ -112,24 +107,20 @@ - (id)initWithRootViewController:(UIViewController *)rootViewController presentationStyle:LGSideMenuPresentationStyleSlideBelow alwaysVisibleOptions:0]; - self.rightViewBackgroundImage = [UIImage imageNamed:@"Image2"]; + self.rightViewBackgroundImage = [UIImage imageNamed:@"image2"]; // ----- - _leftViewController = [LeftViewController new]; _leftViewController.tableView.backgroundColor = [UIColor clearColor]; _leftViewController.tintColor = [UIColor whiteColor]; [_leftViewController.tableView reloadData]; - [self.leftView addSubview:_leftViewController.tableView]; // ----- - _rightViewController = [RightViewController new]; _rightViewController.tableView.backgroundColor = [UIColor clearColor]; _rightViewController.tintColor = [UIColor whiteColor]; [_rightViewController.tableView reloadData]; - [self.rightView addSubview:_rightViewController.tableView]; } else if (TYPE == 4) @@ -138,7 +129,7 @@ - (id)initWithRootViewController:(UIViewController *)rootViewController presentationStyle:LGSideMenuPresentationStyleScaleFromLittle alwaysVisibleOptions:LGSideMenuAlwaysVisibleOnPadLandscape|LGSideMenuAlwaysVisibleOnPhoneLandscape]; - self.leftViewBackgroundImage = [UIImage imageNamed:@"Image"]; + self.leftViewBackgroundImage = [UIImage imageNamed:@"image"]; self.leftViewStatusBarVisibleOptions = LGSideMenuStatusBarVisibleOnPadLandscape; // ----- @@ -152,20 +143,16 @@ - (id)initWithRootViewController:(UIViewController *)rootViewController // ----- - _leftViewController = [LeftViewController new]; _leftViewController.tableView.backgroundColor = [UIColor clearColor]; _leftViewController.tintColor = [UIColor whiteColor]; [_leftViewController.tableView reloadData]; - [self.leftView addSubview:_leftViewController.tableView]; // ----- - _rightViewController = [RightViewController new]; _rightViewController.tableView.backgroundColor = [UIColor clearColor]; _rightViewController.tintColor = [UIColor blackColor]; [_rightViewController.tableView reloadData]; - [self.rightView addSubview:_rightViewController.tableView]; } else if (TYPE == 5) @@ -174,7 +161,7 @@ - (id)initWithRootViewController:(UIViewController *)rootViewController presentationStyle:LGSideMenuPresentationStyleScaleFromBig alwaysVisibleOptions:LGSideMenuAlwaysVisibleOnPadLandscape|LGSideMenuAlwaysVisibleOnPhoneLandscape]; - self.leftViewBackgroundImage = [UIImage imageNamed:@"Image"]; + self.leftViewBackgroundImage = [UIImage imageNamed:@"image"]; self.leftViewStatusBarVisibleOptions = LGSideMenuStatusBarVisibleOnPadLandscape; self.leftViewBackgroundImageInitialScale = 1.5; self.leftViewInititialOffsetX = -200.f; @@ -202,20 +189,16 @@ - (id)initWithRootViewController:(UIViewController *)rootViewController // ----- - _leftViewController = [LeftViewController new]; _leftViewController.tableView.backgroundColor = [UIColor clearColor]; _leftViewController.tintColor = [UIColor whiteColor]; [_leftViewController.tableView reloadData]; - [self.leftView addSubview:_leftViewController.tableView]; // ----- - _rightViewController = [RightViewController new]; _rightViewController.tableView.backgroundColor = [UIColor clearColor]; _rightViewController.tintColor = [UIColor blackColor]; [_rightViewController.tableView reloadData]; - [self.rightView addSubview:_rightViewController.tableView]; } } diff --git a/Demo/LGSideMenuControllerDemo/ViewController.h b/Demo/LGSideMenuControllerDemo/ViewController.h index 7c22159..2ce1c26 100644 --- a/Demo/LGSideMenuControllerDemo/ViewController.h +++ b/Demo/LGSideMenuControllerDemo/ViewController.h @@ -10,7 +10,4 @@ @interface ViewController : UIViewController -@property (strong, nonatomic) UIImageView *imageView; -@property (strong, nonatomic) UIButton *button; - @end diff --git a/Demo/LGSideMenuControllerDemo/ViewController.m b/Demo/LGSideMenuControllerDemo/ViewController.m index f0b0c74..45e3570 100644 --- a/Demo/LGSideMenuControllerDemo/ViewController.m +++ b/Demo/LGSideMenuControllerDemo/ViewController.m @@ -11,6 +11,9 @@ @interface ViewController () +@property (strong, nonatomic) UIImageView *imageView; +@property (strong, nonatomic) UIButton *button; + @end @implementation ViewController diff --git a/Demo/LGSideMenuControllerDemo/image.png b/Demo/LGSideMenuControllerDemo/image.png new file mode 100644 index 0000000..4ca2eb4 Binary files /dev/null and b/Demo/LGSideMenuControllerDemo/image.png differ diff --git a/LGSideMenuController/LGSideMenuController.h b/LGSideMenuController/LGSideMenuController.h index ed7e591..6a60ec7 100644 --- a/LGSideMenuController/LGSideMenuController.h +++ b/LGSideMenuController/LGSideMenuController.h @@ -79,32 +79,32 @@ LGSideMenuPresentationStyle; @property (assign, nonatomic, readonly) LGSideMenuAlwaysVisibleOptions leftViewAlwaysVisibleOptions; @property (assign, nonatomic, readonly) LGSideMenuAlwaysVisibleOptions rightViewAlwaysVisibleOptions; -@property (assign, nonatomic) LGSideMenuStatusBarVisibleOptions leftViewStatusBarVisibleOptions; -@property (assign, nonatomic) LGSideMenuStatusBarVisibleOptions rightViewStatusBarVisibleOptions; +@property (assign, nonatomic) IBInspectable LGSideMenuStatusBarVisibleOptions leftViewStatusBarVisibleOptions; +@property (assign, nonatomic) IBInspectable LGSideMenuStatusBarVisibleOptions rightViewStatusBarVisibleOptions; @property (assign, nonatomic, getter=isLeftViewShowing) BOOL leftViewShowing; @property (assign, nonatomic, getter=isRightViewShowing) BOOL rightViewShowing; /** Default is YES */ -@property (assign, nonatomic, getter=isLeftViewHidesOnTouch) BOOL leftViewHidesOnTouch; +@property (assign, nonatomic, getter=isLeftViewHidesOnTouch) IBInspectable BOOL leftViewHidesOnTouch; /** Default is YES */ -@property (assign, nonatomic, getter=isRightViewHidesOnTouch) BOOL rightViewHidesOnTouch; +@property (assign, nonatomic, getter=isRightViewHidesOnTouch) IBInspectable BOOL rightViewHidesOnTouch; /** Default is YES */ -@property (assign, nonatomic, getter=isLeftViewSwipeGestureEnabled) BOOL leftViewSwipeGestureEnabled; +@property (assign, nonatomic, getter=isLeftViewSwipeGestureEnabled) IBInspectable BOOL leftViewSwipeGestureEnabled; /** Default is YES */ -@property (assign, nonatomic, getter=isRightViewSwipeGestureEnabled) BOOL rightViewSwipeGestureEnabled; +@property (assign, nonatomic, getter=isRightViewSwipeGestureEnabled) IBInspectable BOOL rightViewSwipeGestureEnabled; -/** - Color that hides root view, when left view is showing +/** + Color that hides root view, when left view is showing For LGSideMenuPresentationStyleSlideAbove default is [UIColor colorWithWhite:0.f alpha:0.5] */ -@property (strong, nonatomic) UIColor *rootViewCoverColorForLeftView; +@property (strong, nonatomic) IBInspectable UIColor *rootViewCoverColorForLeftView; /** Color that hides root view, when right view is showing For LGSideMenuPresentationStyleSlideAbove default is [UIColor colorWithWhite:0.f alpha:0.5] */ -@property (strong, nonatomic) UIColor *rootViewCoverColorForRightView; +@property (strong, nonatomic) IBInspectable UIColor *rootViewCoverColorForRightView; /** Only if (presentationStyle == LGSideMenuPresentationStyleSlideBelow || LGSideMenuPresentationStyleScaleFromBig || LGSideMenuPresentationStyleScaleFromLittle). @@ -112,45 +112,45 @@ LGSideMenuPresentationStyle; For LGSideMenuPresentationStyleScaleFromBig default is 0.8. For LGSideMenuPresentationStyleScaleFromLittle default is 0.8. */ -@property (assign, nonatomic) CGFloat rootViewScaleForLeftView; +@property (assign, nonatomic) IBInspectable CGFloat rootViewScaleForLeftView; /** Only if (presentationStyle == LGSideMenuPresentationStyleSlideBelow || LGSideMenuPresentationStyleScaleFromBig || LGSideMenuPresentationStyleScaleFromLittle). For LGSideMenuPresentationStyleSlideBelow default is 1. For LGSideMenuPresentationStyleScaleFromBig default is 0.8. For LGSideMenuPresentationStyleScaleFromLittle default is 0.8. */ -@property (assign, nonatomic) CGFloat rootViewScaleForRightView; +@property (assign, nonatomic) IBInspectable CGFloat rootViewScaleForRightView; /** Color that hides left view, when if is not showing. Only if (presentationStyle == LGSideMenuPresentationStyleSlideBelow || LGSideMenuPresentationStyleScaleFromBig || LGSideMenuPresentationStyleScaleFromLittle) Default is [UIColor colorWithWhite:0.f alpha:0.5] */ -@property (strong, nonatomic) UIColor *leftViewCoverColor; +@property (strong, nonatomic) IBInspectable UIColor *leftViewCoverColor; /** Color that hides right view, when if is not showing. Only if (presentationStyle == LGSideMenuPresentationStyleSlideBelow || LGSideMenuPresentationStyleScaleFromBig || LGSideMenuPresentationStyleScaleFromLittle) Default is [UIColor colorWithWhite:0.f alpha:0.5] */ -@property (strong, nonatomic) UIColor *rightViewCoverColor; +@property (strong, nonatomic)IBInspectable UIColor *rightViewCoverColor; /** Only if (presentationStyle == LGSideMenuPresentationStyleSlideBelow || LGSideMenuPresentationStyleScaleFromBig || LGSideMenuPresentationStyleScaleFromLittle) */ -@property (strong, nonatomic) UIImage *leftViewBackgroundImage; +@property (strong, nonatomic) IBInspectable UIImage *leftViewBackgroundImage; /** Only if (presentationStyle == LGSideMenuPresentationStyleSlideBelow || LGSideMenuPresentationStyleScaleFromBig || LGSideMenuPresentationStyleScaleFromLittle) */ -@property (strong, nonatomic) UIImage *rightViewBackgroundImage; +@property (strong, nonatomic) IBInspectable UIImage *rightViewBackgroundImage; /** Only if (presentationStyle == LGSideMenuPresentationStyleSlideBelow || LGSideMenuPresentationStyleScaleFromBig || LGSideMenuPresentationStyleScaleFromLittle). For LGSideMenuPresentationStyleSlideBelow default is 1. For LGSideMenuPresentationStyleScaleFromBig and LGSideMenuPresentationStyleScaleFromLittle default is 1.4. */ -@property (assign, nonatomic) CGFloat leftViewBackgroundImageInitialScale; +@property (assign, nonatomic) IBInspectable CGFloat leftViewBackgroundImageInitialScale; /** Only if (presentationStyle == LGSideMenuPresentationStyleSlideBelow || LGSideMenuPresentationStyleScaleFromBig || LGSideMenuPresentationStyleScaleFromLittle). For LGSideMenuPresentationStyleSlideBelow default is 1. For LGSideMenuPresentationStyleScaleFromBig and LGSideMenuPresentationStyleScaleFromLittle default is 1.4. */ -@property (assign, nonatomic) CGFloat rightViewBackgroundImageInitialScale; +@property (assign, nonatomic) IBInspectable CGFloat rightViewBackgroundImageInitialScale; /** Only if (presentationStyle == LGSideMenuPresentationStyleSlideBelow || LGSideMenuPresentationStyleScaleFromBig || LGSideMenuPresentationStyleScaleFromLittle). @@ -158,14 +158,14 @@ LGSideMenuPresentationStyle; For LGSideMenuPresentationStyleScaleFromBig default is 1.2. For LGSideMenuPresentationStyleScaleFromLittle default is 0.8. */ -@property (assign, nonatomic) CGFloat leftViewInititialScale; +@property (assign, nonatomic) IBInspectable CGFloat leftViewInititialScale; /** Only if (presentationStyle == LGSideMenuPresentationStyleSlideBelow || LGSideMenuPresentationStyleScaleFromBig || LGSideMenuPresentationStyleScaleFromLittle). For LGSideMenuPresentationStyleSlideBelow default is 1. For LGSideMenuPresentationStyleScaleFromBig default is 1.2. For LGSideMenuPresentationStyleScaleFromLittle default is 0.8. */ -@property (assign, nonatomic) CGFloat rightViewInititialScale; +@property (assign, nonatomic) IBInspectable CGFloat rightViewInititialScale; /** Only if (presentationStyle == LGSideMenuPresentationStyleSlideBelow || LGSideMenuPresentationStyleScaleFromBig || LGSideMenuPresentationStyleScaleFromLittle). @@ -173,42 +173,37 @@ LGSideMenuPresentationStyle; For LGSideMenuPresentationStyleScaleFromBig default is 0. For LGSideMenuPresentationStyleScaleFromLittle default is 0. */ -@property (assign, nonatomic) CGFloat leftViewInititialOffsetX; +@property (assign, nonatomic) IBInspectable CGFloat leftViewInititialOffsetX; /** Only if (presentationStyle == LGSideMenuPresentationStyleSlideBelow || LGSideMenuPresentationStyleScaleFromBig || LGSideMenuPresentationStyleScaleFromLittle). For LGSideMenuPresentationStyleSlideBelow default is width/2. For LGSideMenuPresentationStyleScaleFromBig default is 0. For LGSideMenuPresentationStyleScaleFromLittle default is 0. */ -@property (assign, nonatomic) CGFloat rightViewInititialOffsetX; +@property (assign, nonatomic) IBInspectable CGFloat rightViewInititialOffsetX; -@property (strong, nonatomic) UIColor *rootViewLayerBorderColor; -@property (assign, nonatomic) CGFloat rootViewLayerBorderWidth; +@property (strong, nonatomic) IBInspectable UIColor *rootViewLayerBorderColor; +@property (assign, nonatomic) IBInspectable CGFloat rootViewLayerBorderWidth; /** For (presentationStyle == LGSideMenuPresentationStyleSlideBelow || LGSideMenuPresentationStyleScaleFromBig || LGSideMenuPresentationStyleScaleFromLittle) default is [UIColor colorWithWhite:0.f alpha:0.5] */ -@property (strong, nonatomic) UIColor *rootViewLayerShadowColor; +@property (strong, nonatomic) IBInspectable UIColor *rootViewLayerShadowColor; /** For (presentationStyle == LGSideMenuPresentationStyleSlideBelow || LGSideMenuPresentationStyleScaleFromBig || LGSideMenuPresentationStyleScaleFromLittle) default is 5.f */ -@property (assign, nonatomic) CGFloat rootViewLayerShadowRadius; +@property (assign, nonatomic) IBInspectable CGFloat rootViewLayerShadowRadius; -@property (strong, nonatomic) UIColor *leftViewBackgroundColor; -@property (strong, nonatomic) UIColor *leftViewLayerBorderColor; -@property (assign, nonatomic) CGFloat leftViewLayerBorderWidth; +@property (strong, nonatomic) IBInspectable UIColor *leftViewBackgroundColor; +@property (strong, nonatomic) IBInspectable UIColor *leftViewLayerBorderColor; +@property (assign, nonatomic) IBInspectable CGFloat leftViewLayerBorderWidth; /** For LGSideMenuPresentationStyleSlideAbove default is [UIColor colorWithWhite:0.f alpha:0.5] */ -@property (strong, nonatomic) UIColor *leftViewLayerShadowColor; +@property (strong, nonatomic) IBInspectable UIColor *leftViewLayerShadowColor; /** For LGSideMenuPresentationStyleSlideAbove default is 5.f */ -@property (assign, nonatomic) CGFloat leftViewLayerShadowRadius; +@property (assign, nonatomic) IBInspectable CGFloat leftViewLayerShadowRadius; -@property (strong, nonatomic) UIColor *rightViewBackgroundColor; -@property (strong, nonatomic) UIColor *rightViewLayerBorderColor; -@property (assign, nonatomic) CGFloat rightViewLayerBorderWidth; +@property (strong, nonatomic) IBInspectable UIColor *rightViewBackgroundColor; +@property (strong, nonatomic) IBInspectable UIColor *rightViewLayerBorderColor; +@property (assign, nonatomic) IBInspectable CGFloat rightViewLayerBorderWidth; /** For LGSideMenuPresentationStyleSlideAbove default is [UIColor colorWithWhite:0.f alpha:0.5] */ -@property (strong, nonatomic) UIColor *rightViewLayerShadowColor; +@property (strong, nonatomic) IBInspectable UIColor *rightViewLayerShadowColor; /** For LGSideMenuPresentationStyleSlideAbove default is 5.f */ -@property (assign, nonatomic) CGFloat rightViewLayerShadowRadius; - -/** Default is YES */ -@property (assign, nonatomic, getter=isLeftViewGestureEnabled) BOOL leftViewGestureEnabled; -/** Default is YES */ -@property (assign, nonatomic, getter=isRightViewGestureEnabled) BOOL rightViewGestureEnabled; +@property (assign, nonatomic) IBInspectable CGFloat rightViewLayerShadowRadius; - (instancetype)initWithRootViewController:(UIViewController *)rootViewController; diff --git a/LGSideMenuController/LGSideMenuController.m b/LGSideMenuController/LGSideMenuController.m index 22061cc..946e62a 100644 --- a/LGSideMenuController/LGSideMenuController.m +++ b/LGSideMenuController/LGSideMenuController.m @@ -151,6 +151,7 @@ - (instancetype)init self = [super init]; if (self) { + [self setupDefaultProperties]; [self setupDefaults]; } return self; @@ -163,53 +164,61 @@ - (instancetype)initWithRootViewController:(UIViewController *)rootViewControlle { _rootVC = rootViewController; + [self setupDefaultProperties]; [self setupDefaults]; } return self; } -- (void)setupDefaults +- (id)initWithCoder:(NSCoder *)aDecoder { - self.view.clipsToBounds = YES; - - // ----- - - _leftViewGestureEnabled = YES; - _rightViewGestureEnabled = YES; - - // ----- - - _backgroundImageView = [UIImageView new]; - _backgroundImageView.hidden = YES; - _backgroundImageView.contentMode = UIViewContentModeScaleAspectFill; - _backgroundImageView.backgroundColor = [UIColor clearColor]; - [self.view addSubview:_backgroundImageView]; - - // ----- + self = [super initWithCoder:aDecoder]; + if (self) + { + [self setupDefaultProperties]; + } + return self; +} + +- (void)awakeFromNib +{ + [super awakeFromNib]; + [self setupDefaults]; +} + +- (void)setupDefaultProperties +{ _leftViewHidesOnTouch = YES; _rightViewHidesOnTouch = YES; _leftViewSwipeGestureEnabled = YES; _rightViewSwipeGestureEnabled = YES; - _rootViewLayerBorderColor = nil; - _rootViewLayerBorderWidth = 0.f; _rootViewLayerShadowColor = [UIColor colorWithWhite:0.f alpha:0.5]; _rootViewLayerShadowRadius = 5.f; - _leftViewLayerBorderColor = nil; - _leftViewLayerBorderWidth = 0.f; _leftViewLayerShadowColor = [UIColor colorWithWhite:0.f alpha:0.5]; _leftViewLayerShadowRadius = 5.f; - _rightViewLayerBorderColor = nil; - _rightViewLayerBorderWidth = 0.f; _rightViewLayerShadowColor = [UIColor colorWithWhite:0.f alpha:0.5]; _rightViewLayerShadowRadius = 5.f; _leftViewCoverColor = kLGSideMenuCoverColor; _rightViewCoverColor = kLGSideMenuCoverColor; +} + +- (void)setupDefaults +{ + self.view.clipsToBounds = YES; + + // ----- + + _backgroundImageView = [UIImageView new]; + _backgroundImageView.hidden = YES; + _backgroundImageView.contentMode = UIViewContentModeScaleAspectFill; + _backgroundImageView.backgroundColor = [UIColor clearColor]; + [self.view addSubview:_backgroundImageView]; // ----- @@ -270,10 +279,10 @@ - (void)viewWillLayoutSubviews // ----- + [self colorsInvalidate]; [self rootViewLayoutInvalidateWithPercentage:(self.isLeftViewShowing || self.isRightViewShowing ? 1.f : 0.f)]; [self leftViewLayoutInvalidateWithPercentage:(self.isLeftViewShowing ? 1.f : 0.f)]; [self rightViewLayoutInvalidateWithPercentage:(self.isRightViewShowing ? 1.f : 0.f)]; - [self colorsInvalidate]; [self hiddensInvalidateWithDelay:(appeared ? 0.25 : 0.0)]; } } @@ -313,7 +322,7 @@ - (void)setRootViewController:(UIViewController *)rootViewController [self.view addSubview:_leftView]; else [self.view insertSubview:_leftView belowSubview:_rootVC.view]; - + } if (_rightView) @@ -1172,12 +1181,12 @@ - (void)showLeftViewAnimated:(BOOL)animated fromPercentage:(CGFloat)percentage c if (animated) { [LGSideMenuController animateStandardWithDuration:0.5//*(1.f-percentage) - animations:^(void) + animations:^(void) { [self rootViewLayoutInvalidateWithPercentage:1.f]; [self leftViewLayoutInvalidateWithPercentage:1.f]; } - completion:^(BOOL finished) + completion:^(BOOL finished) { if (finished) [self hiddensInvalidate]; @@ -1225,12 +1234,12 @@ - (void)hideLeftViewAnimated:(BOOL)animated fromPercentage:(CGFloat)percentage c if (animated) { [LGSideMenuController animateStandardWithDuration:0.5//*percentage - animations:^(void) + animations:^(void) { [self rootViewLayoutInvalidateWithPercentage:0.f]; [self leftViewLayoutInvalidateWithPercentage:0.f]; } - completion:^(BOOL finished) + completion:^(BOOL finished) { _leftViewShowing = NO; @@ -1326,12 +1335,12 @@ - (void)showRightViewAnimated:(BOOL)animated fromPercentage:(CGFloat)percentage if (animated) { [LGSideMenuController animateStandardWithDuration:0.5//*(1.f-percentage) - animations:^(void) + animations:^(void) { [self rootViewLayoutInvalidateWithPercentage:1.f]; [self rightViewLayoutInvalidateWithPercentage:1.f]; } - completion:^(BOOL finished) + completion:^(BOOL finished) { if (finished) [self hiddensInvalidate]; @@ -1379,12 +1388,12 @@ - (void)hideRightViewAnimated:(BOOL)animated fromPercentage:(CGFloat)percentage if (animated) { [LGSideMenuController animateStandardWithDuration:0.5//*percentage - animations:^(void) + animations:^(void) { [self rootViewLayoutInvalidateWithPercentage:0.f]; [self rightViewLayoutInvalidateWithPercentage:0.f]; } - completion:^(BOOL finished) + completion:^(BOOL finished) { _rightViewShowing = NO; @@ -1457,7 +1466,7 @@ - (void)panGesture:(UIPanGestureRecognizer *)gestureRecognizer // ----- - if (_leftView && self.isLeftViewGestureEnabled && !kLGSideMenuIsLeftViewAlwaysVisible && !_rightViewGestireStartX && !self.isRightViewShowing) + if (_leftView && self.isLeftViewSwipeGestureEnabled && !kLGSideMenuIsLeftViewAlwaysVisible && !_rightViewGestireStartX && !self.isRightViewShowing) { if (!_leftViewGestireStartX && (gestureRecognizer.state == UIGestureRecognizerStateBegan || gestureRecognizer.state == UIGestureRecognizerStateChanged)) { @@ -1507,7 +1516,7 @@ - (void)panGesture:(UIPanGestureRecognizer *)gestureRecognizer // ----- - if (_rightView && self.isRightViewGestureEnabled && !kLGSideMenuIsRightViewAlwaysVisible && !_leftViewGestireStartX && !self.isLeftViewShowing) + if (_rightView && self.isRightViewSwipeGestureEnabled && !kLGSideMenuIsRightViewAlwaysVisible && !_leftViewGestireStartX && !self.isLeftViewShowing) { if (!_rightViewGestireStartX && (gestureRecognizer.state == UIGestureRecognizerStateBegan || gestureRecognizer.state == UIGestureRecognizerStateChanged)) {