From df693d091ad8d2566aa56e2e24d384439a529360 Mon Sep 17 00:00:00 2001 From: honcheng Date: Fri, 26 Oct 2012 23:12:08 +0800 Subject: [PATCH] first commit, with a working menu controller. uses containment view --- .gitmodules | 3 + Demo/Demo.xcodeproj/project.pbxproj | 406 ++++++++++++++++++ Demo/Demo/AppDelegate.h | 16 + Demo/Demo/AppDelegate.m | 47 ++ Demo/Demo/Default-568h@2x.png | Bin 0 -> 18594 bytes Demo/Demo/Default.png | Bin 0 -> 6540 bytes Demo/Demo/Default@2x.png | Bin 0 -> 16107 bytes Demo/Demo/Demo-Info.plist | 36 ++ Demo/Demo/Demo-Prefix.pch | 14 + Demo/Demo/DemoMenuController.h | 14 + Demo/Demo/DemoMenuController.m | 38 ++ Demo/Demo/FirstViewController.h | 13 + Demo/Demo/FirstViewController.m | 38 ++ Demo/Demo/SecondViewController.h | 13 + Demo/Demo/SecondViewController.m | 38 ++ Demo/Demo/ThirdViewController.h | 13 + Demo/Demo/ThirdViewController.m | 38 ++ Demo/Demo/en.lproj/InfoPlist.strings | 2 + Demo/Demo/main.m | 18 + PaperFoldMenuController/PaperFold | 1 + .../PaperFoldMenuController.h | 55 +++ .../PaperFoldMenuController.m | 167 +++++++ 22 files changed, 970 insertions(+) create mode 100644 .gitmodules create mode 100644 Demo/Demo.xcodeproj/project.pbxproj create mode 100644 Demo/Demo/AppDelegate.h create mode 100644 Demo/Demo/AppDelegate.m create mode 100644 Demo/Demo/Default-568h@2x.png create mode 100644 Demo/Demo/Default.png create mode 100644 Demo/Demo/Default@2x.png create mode 100644 Demo/Demo/Demo-Info.plist create mode 100644 Demo/Demo/Demo-Prefix.pch create mode 100644 Demo/Demo/DemoMenuController.h create mode 100644 Demo/Demo/DemoMenuController.m create mode 100644 Demo/Demo/FirstViewController.h create mode 100644 Demo/Demo/FirstViewController.m create mode 100644 Demo/Demo/SecondViewController.h create mode 100644 Demo/Demo/SecondViewController.m create mode 100644 Demo/Demo/ThirdViewController.h create mode 100644 Demo/Demo/ThirdViewController.m create mode 100644 Demo/Demo/en.lproj/InfoPlist.strings create mode 100644 Demo/Demo/main.m create mode 160000 PaperFoldMenuController/PaperFold create mode 100644 PaperFoldMenuController/PaperFoldMenuController.h create mode 100644 PaperFoldMenuController/PaperFoldMenuController.m diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4540920 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "PaperFoldMenuController/PaperFold"] + path = PaperFoldMenuController/PaperFold + url = https://github.com/honcheng/PaperFold-for-iOS.git diff --git a/Demo/Demo.xcodeproj/project.pbxproj b/Demo/Demo.xcodeproj/project.pbxproj new file mode 100644 index 0000000..56cc8e8 --- /dev/null +++ b/Demo/Demo.xcodeproj/project.pbxproj @@ -0,0 +1,406 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + F8938458163AD2BE0085C3BB /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8938457163AD2BE0085C3BB /* UIKit.framework */; }; + F893845A163AD2BE0085C3BB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8938459163AD2BE0085C3BB /* Foundation.framework */; }; + F893845C163AD2BE0085C3BB /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F893845B163AD2BE0085C3BB /* CoreGraphics.framework */; }; + F8938462163AD2BE0085C3BB /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F8938460163AD2BE0085C3BB /* InfoPlist.strings */; }; + F8938464163AD2BE0085C3BB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F8938463163AD2BE0085C3BB /* main.m */; }; + F8938468163AD2BE0085C3BB /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F8938467163AD2BE0085C3BB /* AppDelegate.m */; }; + F893846A163AD2BE0085C3BB /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = F8938469163AD2BE0085C3BB /* Default.png */; }; + F893846C163AD2BE0085C3BB /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F893846B163AD2BE0085C3BB /* Default@2x.png */; }; + F893846E163AD2BE0085C3BB /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F893846D163AD2BE0085C3BB /* Default-568h@2x.png */; }; + F89384C6163AD3BC0085C3BB /* PaperFoldMenuController.m in Sources */ = {isa = PBXBuildFile; fileRef = F89384C5163AD3BC0085C3BB /* PaperFoldMenuController.m */; }; + F8938502163AD49E0085C3BB /* FacingView.m in Sources */ = {isa = PBXBuildFile; fileRef = F89384ED163AD49E0085C3BB /* FacingView.m */; }; + F8938503163AD49E0085C3BB /* FoldView.m in Sources */ = {isa = PBXBuildFile; fileRef = F89384EF163AD49E0085C3BB /* FoldView.m */; }; + F8938504163AD49E0085C3BB /* MultiFoldView.m in Sources */ = {isa = PBXBuildFile; fileRef = F89384F1163AD49E0085C3BB /* MultiFoldView.m */; }; + F8938505163AD49E0085C3BB /* PaperFoldNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = F89384F3163AD49E0085C3BB /* PaperFoldNavigationController.m */; }; + F8938506163AD49E0085C3BB /* PaperFoldResources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = F89384F4163AD49E0085C3BB /* PaperFoldResources.bundle */; }; + F8938507163AD49E0085C3BB /* PaperFoldSwipeHintView.m in Sources */ = {isa = PBXBuildFile; fileRef = F89384F6163AD49E0085C3BB /* PaperFoldSwipeHintView.m */; }; + F8938508163AD49E0085C3BB /* PaperFoldView.m in Sources */ = {isa = PBXBuildFile; fileRef = F89384F8163AD49E0085C3BB /* PaperFoldView.m */; }; + F8938509163AD49E0085C3BB /* swipe_guide.psd in Resources */ = {isa = PBXBuildFile; fileRef = F89384FA163AD49E0085C3BB /* swipe_guide.psd */; }; + F893850A163AD49E0085C3BB /* swipe_guide2.psd in Resources */ = {isa = PBXBuildFile; fileRef = F89384FB163AD49E0085C3BB /* swipe_guide2.psd */; }; + F893850B163AD49E0085C3BB /* ShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = F89384FD163AD49E0085C3BB /* ShadowView.m */; }; + F893850C163AD49E0085C3BB /* TouchThroughUIView.m in Sources */ = {isa = PBXBuildFile; fileRef = F89384FF163AD49E0085C3BB /* TouchThroughUIView.m */; }; + F893850D163AD49E0085C3BB /* UIView+Screenshot.m in Sources */ = {isa = PBXBuildFile; fileRef = F8938501163AD49E0085C3BB /* UIView+Screenshot.m */; }; + F8938513163AD5CE0085C3BB /* FirstViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8938512163AD5CE0085C3BB /* FirstViewController.m */; }; + F8938516163AD5D70085C3BB /* SecondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8938515163AD5D70085C3BB /* SecondViewController.m */; }; + F8938519163AD5E20085C3BB /* ThirdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8938518163AD5E10085C3BB /* ThirdViewController.m */; }; + F8938535163AD6FA0085C3BB /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8938534163AD6FA0085C3BB /* QuartzCore.framework */; }; + F893853C163AD8680085C3BB /* DemoMenuController.m in Sources */ = {isa = PBXBuildFile; fileRef = F893853B163AD8680085C3BB /* DemoMenuController.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + F8938453163AD2BE0085C3BB /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F8938457163AD2BE0085C3BB /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + F8938459163AD2BE0085C3BB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + F893845B163AD2BE0085C3BB /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + F893845F163AD2BE0085C3BB /* Demo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Demo-Info.plist"; sourceTree = ""; }; + F8938461163AD2BE0085C3BB /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + F8938463163AD2BE0085C3BB /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + F8938465163AD2BE0085C3BB /* Demo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Demo-Prefix.pch"; sourceTree = ""; }; + F8938466163AD2BE0085C3BB /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + F8938467163AD2BE0085C3BB /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + F8938469163AD2BE0085C3BB /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; + F893846B163AD2BE0085C3BB /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; + F893846D163AD2BE0085C3BB /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + F89384C4163AD3BC0085C3BB /* PaperFoldMenuController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PaperFoldMenuController.h; path = ../PaperFoldMenuController/PaperFoldMenuController.h; sourceTree = ""; }; + F89384C5163AD3BC0085C3BB /* PaperFoldMenuController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PaperFoldMenuController.m; path = ../PaperFoldMenuController/PaperFoldMenuController.m; sourceTree = ""; }; + F89384EC163AD49E0085C3BB /* FacingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FacingView.h; sourceTree = ""; }; + F89384ED163AD49E0085C3BB /* FacingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FacingView.m; sourceTree = ""; }; + F89384EE163AD49E0085C3BB /* FoldView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FoldView.h; sourceTree = ""; }; + F89384EF163AD49E0085C3BB /* FoldView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FoldView.m; sourceTree = ""; }; + F89384F0163AD49E0085C3BB /* MultiFoldView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MultiFoldView.h; sourceTree = ""; }; + F89384F1163AD49E0085C3BB /* MultiFoldView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MultiFoldView.m; sourceTree = ""; }; + F89384F2163AD49E0085C3BB /* PaperFoldNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaperFoldNavigationController.h; sourceTree = ""; }; + F89384F3163AD49E0085C3BB /* PaperFoldNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PaperFoldNavigationController.m; sourceTree = ""; }; + F89384F4163AD49E0085C3BB /* PaperFoldResources.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = PaperFoldResources.bundle; sourceTree = ""; }; + F89384F5163AD49E0085C3BB /* PaperFoldSwipeHintView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaperFoldSwipeHintView.h; sourceTree = ""; }; + F89384F6163AD49E0085C3BB /* PaperFoldSwipeHintView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PaperFoldSwipeHintView.m; sourceTree = ""; }; + F89384F7163AD49E0085C3BB /* PaperFoldView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaperFoldView.h; sourceTree = ""; }; + F89384F8163AD49E0085C3BB /* PaperFoldView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PaperFoldView.m; sourceTree = ""; }; + F89384FA163AD49E0085C3BB /* swipe_guide.psd */ = {isa = PBXFileReference; lastKnownFileType = file; path = swipe_guide.psd; sourceTree = ""; }; + F89384FB163AD49E0085C3BB /* swipe_guide2.psd */ = {isa = PBXFileReference; lastKnownFileType = file; path = swipe_guide2.psd; sourceTree = ""; }; + F89384FC163AD49E0085C3BB /* ShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowView.h; sourceTree = ""; }; + F89384FD163AD49E0085C3BB /* ShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShadowView.m; sourceTree = ""; }; + F89384FE163AD49E0085C3BB /* TouchThroughUIView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TouchThroughUIView.h; sourceTree = ""; }; + F89384FF163AD49E0085C3BB /* TouchThroughUIView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TouchThroughUIView.m; sourceTree = ""; }; + F8938500163AD49E0085C3BB /* UIView+Screenshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Screenshot.h"; sourceTree = ""; }; + F8938501163AD49E0085C3BB /* UIView+Screenshot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Screenshot.m"; sourceTree = ""; }; + F8938511163AD5CE0085C3BB /* FirstViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FirstViewController.h; sourceTree = ""; }; + F8938512163AD5CE0085C3BB /* FirstViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FirstViewController.m; sourceTree = ""; }; + F8938514163AD5D70085C3BB /* SecondViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecondViewController.h; sourceTree = ""; }; + F8938515163AD5D70085C3BB /* SecondViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecondViewController.m; sourceTree = ""; }; + F8938517163AD5E10085C3BB /* ThirdViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThirdViewController.h; sourceTree = ""; }; + F8938518163AD5E10085C3BB /* ThirdViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThirdViewController.m; sourceTree = ""; }; + F8938534163AD6FA0085C3BB /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + F893853A163AD8680085C3BB /* DemoMenuController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoMenuController.h; sourceTree = ""; }; + F893853B163AD8680085C3BB /* DemoMenuController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoMenuController.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + F8938450163AD2BE0085C3BB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F8938535163AD6FA0085C3BB /* QuartzCore.framework in Frameworks */, + F8938458163AD2BE0085C3BB /* UIKit.framework in Frameworks */, + F893845A163AD2BE0085C3BB /* Foundation.framework in Frameworks */, + F893845C163AD2BE0085C3BB /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + F8938448163AD2BE0085C3BB = { + isa = PBXGroup; + children = ( + F89384BB163AD3500085C3BB /* PaperFoldMenuController */, + F893845D163AD2BE0085C3BB /* Demo */, + F8938456163AD2BE0085C3BB /* Frameworks */, + F8938454163AD2BE0085C3BB /* Products */, + ); + sourceTree = ""; + }; + F8938454163AD2BE0085C3BB /* Products */ = { + isa = PBXGroup; + children = ( + F8938453163AD2BE0085C3BB /* Demo.app */, + ); + name = Products; + sourceTree = ""; + }; + F8938456163AD2BE0085C3BB /* Frameworks */ = { + isa = PBXGroup; + children = ( + F8938534163AD6FA0085C3BB /* QuartzCore.framework */, + F8938457163AD2BE0085C3BB /* UIKit.framework */, + F8938459163AD2BE0085C3BB /* Foundation.framework */, + F893845B163AD2BE0085C3BB /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + F893845D163AD2BE0085C3BB /* Demo */ = { + isa = PBXGroup; + children = ( + F8938466163AD2BE0085C3BB /* AppDelegate.h */, + F8938467163AD2BE0085C3BB /* AppDelegate.m */, + F893853A163AD8680085C3BB /* DemoMenuController.h */, + F893853B163AD8680085C3BB /* DemoMenuController.m */, + F8938511163AD5CE0085C3BB /* FirstViewController.h */, + F8938512163AD5CE0085C3BB /* FirstViewController.m */, + F8938514163AD5D70085C3BB /* SecondViewController.h */, + F8938515163AD5D70085C3BB /* SecondViewController.m */, + F8938517163AD5E10085C3BB /* ThirdViewController.h */, + F8938518163AD5E10085C3BB /* ThirdViewController.m */, + F893845E163AD2BE0085C3BB /* Supporting Files */, + ); + path = Demo; + sourceTree = ""; + }; + F893845E163AD2BE0085C3BB /* Supporting Files */ = { + isa = PBXGroup; + children = ( + F893845F163AD2BE0085C3BB /* Demo-Info.plist */, + F8938460163AD2BE0085C3BB /* InfoPlist.strings */, + F8938463163AD2BE0085C3BB /* main.m */, + F8938465163AD2BE0085C3BB /* Demo-Prefix.pch */, + F8938469163AD2BE0085C3BB /* Default.png */, + F893846B163AD2BE0085C3BB /* Default@2x.png */, + F893846D163AD2BE0085C3BB /* Default-568h@2x.png */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + F89384BB163AD3500085C3BB /* PaperFoldMenuController */ = { + isa = PBXGroup; + children = ( + F89384EB163AD49E0085C3BB /* PaperFold */, + F89384C4163AD3BC0085C3BB /* PaperFoldMenuController.h */, + F89384C5163AD3BC0085C3BB /* PaperFoldMenuController.m */, + ); + name = PaperFoldMenuController; + sourceTree = ""; + }; + F89384EB163AD49E0085C3BB /* PaperFold */ = { + isa = PBXGroup; + children = ( + F89384EC163AD49E0085C3BB /* FacingView.h */, + F89384ED163AD49E0085C3BB /* FacingView.m */, + F89384EE163AD49E0085C3BB /* FoldView.h */, + F89384EF163AD49E0085C3BB /* FoldView.m */, + F89384F0163AD49E0085C3BB /* MultiFoldView.h */, + F89384F1163AD49E0085C3BB /* MultiFoldView.m */, + F89384F2163AD49E0085C3BB /* PaperFoldNavigationController.h */, + F89384F3163AD49E0085C3BB /* PaperFoldNavigationController.m */, + F89384F4163AD49E0085C3BB /* PaperFoldResources.bundle */, + F89384F5163AD49E0085C3BB /* PaperFoldSwipeHintView.h */, + F89384F6163AD49E0085C3BB /* PaperFoldSwipeHintView.m */, + F89384F7163AD49E0085C3BB /* PaperFoldView.h */, + F89384F8163AD49E0085C3BB /* PaperFoldView.m */, + F89384F9163AD49E0085C3BB /* Resources */, + F89384FC163AD49E0085C3BB /* ShadowView.h */, + F89384FD163AD49E0085C3BB /* ShadowView.m */, + F89384FE163AD49E0085C3BB /* TouchThroughUIView.h */, + F89384FF163AD49E0085C3BB /* TouchThroughUIView.m */, + F8938500163AD49E0085C3BB /* UIView+Screenshot.h */, + F8938501163AD49E0085C3BB /* UIView+Screenshot.m */, + ); + name = PaperFold; + path = ../PaperFoldMenuController/PaperFold/PaperFold/PaperFold/PaperFold; + sourceTree = ""; + }; + F89384F9163AD49E0085C3BB /* Resources */ = { + isa = PBXGroup; + children = ( + F89384FA163AD49E0085C3BB /* swipe_guide.psd */, + F89384FB163AD49E0085C3BB /* swipe_guide2.psd */, + ); + path = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + F8938452163AD2BE0085C3BB /* Demo */ = { + isa = PBXNativeTarget; + buildConfigurationList = F8938471163AD2BE0085C3BB /* Build configuration list for PBXNativeTarget "Demo" */; + buildPhases = ( + F893844F163AD2BE0085C3BB /* Sources */, + F8938450163AD2BE0085C3BB /* Frameworks */, + F8938451163AD2BE0085C3BB /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Demo; + productName = Demo; + productReference = F8938453163AD2BE0085C3BB /* Demo.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + F893844A163AD2BE0085C3BB /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0450; + ORGANIZATIONNAME = "Hon Cheng Muh"; + }; + buildConfigurationList = F893844D163AD2BE0085C3BB /* Build configuration list for PBXProject "Demo" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = F8938448163AD2BE0085C3BB; + productRefGroup = F8938454163AD2BE0085C3BB /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + F8938452163AD2BE0085C3BB /* Demo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + F8938451163AD2BE0085C3BB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F8938462163AD2BE0085C3BB /* InfoPlist.strings in Resources */, + F893846A163AD2BE0085C3BB /* Default.png in Resources */, + F893846C163AD2BE0085C3BB /* Default@2x.png in Resources */, + F893846E163AD2BE0085C3BB /* Default-568h@2x.png in Resources */, + F8938506163AD49E0085C3BB /* PaperFoldResources.bundle in Resources */, + F8938509163AD49E0085C3BB /* swipe_guide.psd in Resources */, + F893850A163AD49E0085C3BB /* swipe_guide2.psd in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + F893844F163AD2BE0085C3BB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F8938464163AD2BE0085C3BB /* main.m in Sources */, + F8938468163AD2BE0085C3BB /* AppDelegate.m in Sources */, + F89384C6163AD3BC0085C3BB /* PaperFoldMenuController.m in Sources */, + F8938502163AD49E0085C3BB /* FacingView.m in Sources */, + F8938503163AD49E0085C3BB /* FoldView.m in Sources */, + F8938504163AD49E0085C3BB /* MultiFoldView.m in Sources */, + F8938505163AD49E0085C3BB /* PaperFoldNavigationController.m in Sources */, + F8938507163AD49E0085C3BB /* PaperFoldSwipeHintView.m in Sources */, + F8938508163AD49E0085C3BB /* PaperFoldView.m in Sources */, + F893850B163AD49E0085C3BB /* ShadowView.m in Sources */, + F893850C163AD49E0085C3BB /* TouchThroughUIView.m in Sources */, + F893850D163AD49E0085C3BB /* UIView+Screenshot.m in Sources */, + F8938513163AD5CE0085C3BB /* FirstViewController.m in Sources */, + F8938516163AD5D70085C3BB /* SecondViewController.m in Sources */, + F8938519163AD5E20085C3BB /* ThirdViewController.m in Sources */, + F893853C163AD8680085C3BB /* DemoMenuController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + F8938460163AD2BE0085C3BB /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + F8938461163AD2BE0085C3BB /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + F893846F163AD2BE0085C3BB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + SDKROOT = iphoneos; + }; + name = Debug; + }; + F8938470163AD2BE0085C3BB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + F8938472163AD2BE0085C3BB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Demo/Demo-Prefix.pch"; + INFOPLIST_FILE = "Demo/Demo-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + F8938473163AD2BE0085C3BB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Demo/Demo-Prefix.pch"; + INFOPLIST_FILE = "Demo/Demo-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + F893844D163AD2BE0085C3BB /* Build configuration list for PBXProject "Demo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F893846F163AD2BE0085C3BB /* Debug */, + F8938470163AD2BE0085C3BB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F8938471163AD2BE0085C3BB /* Build configuration list for PBXNativeTarget "Demo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F8938472163AD2BE0085C3BB /* Debug */, + F8938473163AD2BE0085C3BB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = F893844A163AD2BE0085C3BB /* Project object */; +} diff --git a/Demo/Demo/AppDelegate.h b/Demo/Demo/AppDelegate.h new file mode 100644 index 0000000..64d5ac5 --- /dev/null +++ b/Demo/Demo/AppDelegate.h @@ -0,0 +1,16 @@ +// +// AppDelegate.h +// Demo +// +// Created by honcheng on 26/10/12. +// Copyright (c) 2012 Hon Cheng Muh. All rights reserved. +// + +#import +#import "DemoMenuController.h" + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; +@property (nonatomic, strong) DemoMenuController *menuController; +@end diff --git a/Demo/Demo/AppDelegate.m b/Demo/Demo/AppDelegate.m new file mode 100644 index 0000000..f4cc932 --- /dev/null +++ b/Demo/Demo/AppDelegate.m @@ -0,0 +1,47 @@ +// +// AppDelegate.m +// Demo +// +// Created by honcheng on 26/10/12. +// Copyright (c) 2012 Hon Cheng Muh. All rights reserved. +// + +#import "AppDelegate.h" +#import "FirstViewController.h" +#import "SecondViewController.h" +#import "ThirdViewController.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + + _menuController = [[DemoMenuController alloc] initWithMenuWidth:250.0]; + [self.window setRootViewController:_menuController]; + + NSMutableArray *viewControllers = [NSMutableArray array]; + + FirstViewController *firstViewController = [[FirstViewController alloc] init]; + [firstViewController setTitle:@"First View Controller"]; + UINavigationController *firstNavController = [[UINavigationController alloc] initWithRootViewController:firstViewController]; + [viewControllers addObject:firstNavController]; + + SecondViewController *secondViewController = [[SecondViewController alloc] init]; + [secondViewController setTitle:@"Second View Controller"]; + UINavigationController *secondNavController = [[UINavigationController alloc] initWithRootViewController:secondViewController]; + [viewControllers addObject:secondNavController]; + + ThirdViewController *thirdViewController = [[ThirdViewController alloc] init]; + [thirdViewController setTitle:@"Third View Controller"]; + UINavigationController *thirdNavController = [[UINavigationController alloc] initWithRootViewController:thirdViewController]; + [viewControllers addObject:thirdNavController]; + + [_menuController setViewControllers:viewControllers]; + + self.window.backgroundColor = [UIColor whiteColor]; + [self.window makeKeyAndVisible]; + return YES; +} + +@end diff --git a/Demo/Demo/Default-568h@2x.png b/Demo/Demo/Default-568h@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0891b7aabfcf3422423b109c8beed2bab838c607 GIT binary patch literal 18594 zcmeI4X;f257Jx&9fS`ixvS;&$x8J@slQFSel)6zJN=?13FB7H(lQjRkSy8x_-S~tvu2gzn1oS+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;rHJ$U;{~w^hYojl4hRI@SH$^K{YEo=sg)WY87r!*7blQK&qnpDo0`Vn zkl)9u9g=mCh&ZCJS(L4yN3k0kQ zuvg$h2KEEk51T+O0JQ+r0`R>g{jvqM0Mr6d3qUOZwE!?PI7HY@CE|dr sfw?Q;rAv?G4&^^8-z_>&sWXMxvD*gPOU4CBe-*@OtE+wfmVJNyHv)PfH~;_u literal 0 HcmV?d00001 diff --git a/Demo/Demo/Default.png b/Demo/Demo/Default.png new file mode 100644 index 0000000000000000000000000000000000000000..4c8ca6f693f96d511e9113c0eb59eec552354e42 GIT binary patch literal 6540 zcmeAS@N?(olHy`uVBq!ia0y~yU~~ZD2OMlbkt;o0To@QwR5G2N13aCb6#|O#(=u~X z85k@CTSM>X-wqM6>&y>YB4)1;;ojbLbbV-W^iFB1wa3^zCog^LCAReC4K0-?R_2{6 zrP*)4+_uWUy3w5N52M3PW_}MFMP9a~>YLvVZ1D_k*IMQ2QT^fwzoOb(*3gH$%aYWC zkHmcab=va2<#X%jakpJ;<1@F;k__#bwtC&%^D0v(FBh9K&$sK+<}2RJS609D)17$w ztdQP8(eLM8Ka}m_IQ@3wyMKP)l=oM4-?`YS_*P?4V_ORLPxsj&7Ju#kH;>6^Kp?T7~ zl+q?{UOOqV==?+d{=)5s|M~T1mwtH@+Z^$G&eEO9JNP^AX@3jZ*J*!!>lc|1-W%fA z@AOQpXZ_Lt>rxFXrGp*zLPiW@uo_c7C{As>j zWeX)wi+LTp_)@KYZCX{j;H?|1yXT4DnlS(Fr8gyP5|uaX_gLvaW0ScZdnG7o+u{T6 zFI-%d{ls*WuCDa5UJ@|RXv&ejZe}*BMkiWY51&pnRPw(hlykSzvj6e%mYz-GdvzBD zF10?szF_~!jS=?2HyQuPCvARXAe}C}WP|yQ*>5~~=*Nxq8+HHW1~FMDRCP^TcacKuk$ z(U#REVv)D!PhJ*ecH-ELFUrfyV&*)Z)>UCOuS?yd^L@Afk>ihynYPc{^CRwu+JHX+#$@YsC4c|l0t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Zao9n}7N0JrsV#;5Ucr+F*TTzQ8{%f3O zeIUy?WDS|-$LvMc@Z7320)tr}bfIka5hx9H;8H|%our=C+Do0CSFRWue14o5#r8v2 zw=|&r4*eMX%lgCV(ka?*j%H^UuP4LmBC(ON`)&7>NF-|PDRU{-7o`CU0HNbd&c~))@yl9IKu_ zXA+A-!khpP_yx=f#qt2_0ptmgBf4gF!{Y)MW6R$cC1d7@$Yb?+_j zYwfE^5_e`vhT zX=u3r>4$fsxP&apbm@Rcbyuc2T=giqZiMo9@9=oua6#YH0hO-1ak9^rJTPMM qY4Yr5Cu^v99p{E9VdroUHKlRW;M8#BJ^AOQE?e9wSHJo8(7yq;BYKSh literal 0 HcmV?d00001 diff --git a/Demo/Demo/Demo-Info.plist b/Demo/Demo/Demo-Info.plist new file mode 100644 index 0000000..f3ff7ab --- /dev/null +++ b/Demo/Demo/Demo-Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.honcheng.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/Demo/Demo/Demo-Prefix.pch b/Demo/Demo/Demo-Prefix.pch new file mode 100644 index 0000000..b2d2bee --- /dev/null +++ b/Demo/Demo/Demo-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'Demo' target in the 'Demo' project +// + +#import + +#ifndef __IPHONE_3_0 +#warning "This project uses features only available in iOS SDK 3.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Demo/Demo/DemoMenuController.h b/Demo/Demo/DemoMenuController.h new file mode 100644 index 0000000..4e3231b --- /dev/null +++ b/Demo/Demo/DemoMenuController.h @@ -0,0 +1,14 @@ +// +// DemoMenuController.h +// Demo +// +// Created by honcheng on 26/10/12. +// Copyright (c) 2012 Hon Cheng Muh. All rights reserved. +// + +#import +#import "PaperFoldMenuController.h" + +@interface DemoMenuController : PaperFoldMenuController + +@end diff --git a/Demo/Demo/DemoMenuController.m b/Demo/Demo/DemoMenuController.m new file mode 100644 index 0000000..ee1875b --- /dev/null +++ b/Demo/Demo/DemoMenuController.m @@ -0,0 +1,38 @@ +// +// DemoMenuController.m +// Demo +// +// Created by honcheng on 26/10/12. +// Copyright (c) 2012 Hon Cheng Muh. All rights reserved. +// + +#import "DemoMenuController.h" + +@interface DemoMenuController () + +@end + +@implementation DemoMenuController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/Demo/Demo/FirstViewController.h b/Demo/Demo/FirstViewController.h new file mode 100644 index 0000000..8a927f3 --- /dev/null +++ b/Demo/Demo/FirstViewController.h @@ -0,0 +1,13 @@ +// +// FirstViewController.h +// Demo +// +// Created by honcheng on 26/10/12. +// Copyright (c) 2012 Hon Cheng Muh. All rights reserved. +// + +#import + +@interface FirstViewController : UIViewController + +@end diff --git a/Demo/Demo/FirstViewController.m b/Demo/Demo/FirstViewController.m new file mode 100644 index 0000000..8e6df02 --- /dev/null +++ b/Demo/Demo/FirstViewController.m @@ -0,0 +1,38 @@ +// +// FirstViewController.m +// Demo +// +// Created by honcheng on 26/10/12. +// Copyright (c) 2012 Hon Cheng Muh. All rights reserved. +// + +#import "FirstViewController.h" + +@interface FirstViewController () + +@end + +@implementation FirstViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/Demo/Demo/SecondViewController.h b/Demo/Demo/SecondViewController.h new file mode 100644 index 0000000..f90bf84 --- /dev/null +++ b/Demo/Demo/SecondViewController.h @@ -0,0 +1,13 @@ +// +// SecondViewController.h +// Demo +// +// Created by honcheng on 26/10/12. +// Copyright (c) 2012 Hon Cheng Muh. All rights reserved. +// + +#import + +@interface SecondViewController : UIViewController + +@end diff --git a/Demo/Demo/SecondViewController.m b/Demo/Demo/SecondViewController.m new file mode 100644 index 0000000..f3d8e18 --- /dev/null +++ b/Demo/Demo/SecondViewController.m @@ -0,0 +1,38 @@ +// +// SecondViewController.m +// Demo +// +// Created by honcheng on 26/10/12. +// Copyright (c) 2012 Hon Cheng Muh. All rights reserved. +// + +#import "SecondViewController.h" + +@interface SecondViewController () + +@end + +@implementation SecondViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/Demo/Demo/ThirdViewController.h b/Demo/Demo/ThirdViewController.h new file mode 100644 index 0000000..d51aa4c --- /dev/null +++ b/Demo/Demo/ThirdViewController.h @@ -0,0 +1,13 @@ +// +// ThirdViewController.h +// Demo +// +// Created by honcheng on 26/10/12. +// Copyright (c) 2012 Hon Cheng Muh. All rights reserved. +// + +#import + +@interface ThirdViewController : UIViewController + +@end diff --git a/Demo/Demo/ThirdViewController.m b/Demo/Demo/ThirdViewController.m new file mode 100644 index 0000000..c3dd49c --- /dev/null +++ b/Demo/Demo/ThirdViewController.m @@ -0,0 +1,38 @@ +// +// ThirdViewController.m +// Demo +// +// Created by honcheng on 26/10/12. +// Copyright (c) 2012 Hon Cheng Muh. All rights reserved. +// + +#import "ThirdViewController.h" + +@interface ThirdViewController () + +@end + +@implementation ThirdViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/Demo/Demo/en.lproj/InfoPlist.strings b/Demo/Demo/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Demo/Demo/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Demo/Demo/main.m b/Demo/Demo/main.m new file mode 100644 index 0000000..5c999d3 --- /dev/null +++ b/Demo/Demo/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Demo +// +// Created by honcheng on 26/10/12. +// Copyright (c) 2012 Hon Cheng Muh. 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/PaperFoldMenuController/PaperFold b/PaperFoldMenuController/PaperFold new file mode 160000 index 0000000..8b52c9b --- /dev/null +++ b/PaperFoldMenuController/PaperFold @@ -0,0 +1 @@ +Subproject commit 8b52c9b21cb099d10449b7afcb5d0cab6f8a291a diff --git a/PaperFoldMenuController/PaperFoldMenuController.h b/PaperFoldMenuController/PaperFoldMenuController.h new file mode 100644 index 0000000..b71129d --- /dev/null +++ b/PaperFoldMenuController/PaperFoldMenuController.h @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2012 Muh Hon Cheng + * Created by honcheng on 26/10/12. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT + * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT + * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR + * IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * @author Muh Hon Cheng + * @copyright 2012 Muh Hon Cheng + * @version + * + */ + +#import +#import "PaperFoldView.h" + +@interface PaperFoldMenuController : UIViewController +@property (nonatomic, strong) PaperFoldView *paperFoldView; +@property (nonatomic, strong) NSMutableArray *viewControllers; +@property (nonatomic, strong) UITableView *menuTableView; +@property (nonatomic, strong) UIView *contentView; +/** + * Set and return the current view controller; + */ +@property (nonatomic, strong) UIViewController *selectedViewController; +/** + * Set and return the index of the current view controller + */ +@property (nonatomic, assign) NSUInteger selectedIndex; +/** + * This method initialize the view controller with + * the width of the menu table view on the left + */ +- (id)initWithMenuWidth:(float)menuWidth; +@end diff --git a/PaperFoldMenuController/PaperFoldMenuController.m b/PaperFoldMenuController/PaperFoldMenuController.m new file mode 100644 index 0000000..0a14c09 --- /dev/null +++ b/PaperFoldMenuController/PaperFoldMenuController.m @@ -0,0 +1,167 @@ +/** + * Copyright (c) 2012 Muh Hon Cheng + * Created by honcheng on 26/10/12. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT + * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT + * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR + * IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * @author Muh Hon Cheng + * @copyright 2012 Muh Hon Cheng + * @version + * + */ + +#import "PaperFoldMenuController.h" + +@interface PaperFoldMenuController () +/** + * This method reloads the menu on the left + * and refresh the screenshot of the menu used in + * PaperFold + */ +- (void)reloadMenu; +@end + +@implementation PaperFoldMenuController + +- (id)initWithMenuWidth:(float)menuWidth +{ + self = [super init]; + if (self) + { + _paperFoldView = [[PaperFoldView alloc] initWithFrame:CGRectMake(0, 0, [self.view bounds].size.width, [self.view bounds].size.height)]; + [_paperFoldView setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth]; + [_paperFoldView setDelegate:self]; + [_paperFoldView setUseOptimizedScreenshot:NO]; + [self.view addSubview:_paperFoldView]; + + _contentView = [[UIView alloc] initWithFrame:_paperFoldView.frame]; + [_contentView setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth]; + [_paperFoldView setCenterContentView:_contentView]; + + _menuTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, menuWidth, [self.view bounds].size.height)]; + [_paperFoldView setLeftFoldContentView:_menuTableView foldCount:3 pullFactor:0.9]; + [_menuTableView setDelegate:self]; + [_menuTableView setDataSource:self]; + + } + return self; +} + +- (void)setViewControllers:(NSMutableArray *)viewControllers +{ + _viewControllers = viewControllers; + if ([_viewControllers count]>0) [self setSelectedIndex:0]; + [self reloadMenu]; +} + +- (void)addViewController:(UIViewController*)viewController; +{ + if (!_viewControllers) _viewControllers = [NSMutableArray array]; + [self.viewControllers addObject:viewController]; + [self reloadMenu]; +} + +- (void)reloadMenu +{ + [self.menuTableView reloadData]; + [self.paperFoldView.leftFoldView.contentView setHidden:NO]; + [self.paperFoldView.leftFoldView drawScreenshotOnFolds]; + [self.paperFoldView.leftFoldView.contentView setHidden:YES]; +} + +#define TAG_CURRENT_VIEWCONTROLLER 1212 + +- (void)setSelectedIndex:(NSUInteger)selectedIndex +{ + _selectedIndex = selectedIndex; + + UIView *lastView = (UIView*)[self.contentView viewWithTag:TAG_CURRENT_VIEWCONTROLLER]; + if (lastView) + { + UIViewController *lastViewController = nil; + for (UIViewController *viewController in self.viewControllers) + { + if (viewController.view == lastView) lastViewController = viewController; + } + [lastViewController willMoveToParentViewController:nil]; + [lastViewController.view removeFromSuperview]; + [lastViewController removeFromParentViewController]; + } + + _selectedViewController = self.viewControllers[_selectedIndex]; + [_selectedViewController.view setFrame:self.contentView.frame]; + [_selectedViewController.view setTag:TAG_CURRENT_VIEWCONTROLLER]; + [self addChildViewController:_selectedViewController]; + [self.contentView addSubview:_selectedViewController.view]; + [_selectedViewController didMoveToParentViewController:self]; +} + +- (void)setSelectedViewController:(UIViewController *)selectedViewController +{ + _selectedViewController = selectedViewController; + int index = [self.viewControllers indexOfObject:_selectedViewController]; + [self setSelectedIndex:index]; +} + +#pragma mark table view delegates and datasource + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + if (tableView==self.menuTableView) return [self.viewControllers count]; + else return 0; +} + +- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (tableView==self.menuTableView) + { + static NSString *identifier = @"identifier"; + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; + if (!cell) + { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; + } + + UIViewController *viewController = self.viewControllers[indexPath.row]; + [cell.textLabel setText:viewController.title]; + + if (indexPath.row==self.selectedIndex) + { + [tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; + } + + return cell; + } + else return nil; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (tableView==self.menuTableView) + { + [self setSelectedIndex:indexPath.row]; + } +} + +@end