Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: weissi/FRShutterViewController
base: d75b559201
...
head fork: weissi/FRShutterViewController
compare: fa66157ee9
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 22 files changed
  • 0 commit comments
  • 1 contributor
Showing with 1,751 additions and 0 deletions.
  1. +486 −0 FRShutterViewController.xcodeproj/project.pbxproj
  2. +13 −0 FRShutterViewController/FRShutterDecorationView.h
  3. +31 −0 FRShutterViewController/FRShutterDecorationView.m
  4. +24 −0 FRShutterViewController/FRShutterDecorationViewController.h
  5. +235 −0 FRShutterViewController/FRShutterDecorationViewController.m
  6. +7 −0 FRShutterViewController/FRShutterViewController-Prefix.pch
  7. +46 −0 FRShutterViewController/FRShutterViewController.h
  8. +279 −0 FRShutterViewController/FRShutterViewController.m
  9. +17 −0 FRShutterViewController/UIViewController+FRShutterViewController.h
  10. +29 −0 FRShutterViewController/UIViewController+FRShutterViewController.m
  11. +15 −0 FRShutterViewControllerDemo/FRAppDelegate.h
  12. +65 −0 FRShutterViewControllerDemo/FRAppDelegate.m
  13. +39 −0 FRShutterViewControllerDemo/FRShutterViewControllerDemo-Info.plist
  14. +14 −0 FRShutterViewControllerDemo/FRShutterViewControllerDemo-Prefix.pch
  15. +29 −0 FRShutterViewControllerDemo/SampleContentViewController.h
  16. +129 −0 FRShutterViewControllerDemo/SampleContentViewController.m
  17. +24 −0 FRShutterViewControllerDemo/SampleListViewController.h
  18. +249 −0 FRShutterViewControllerDemo/SampleListViewController.m
  19. BIN  FRShutterViewControllerDemo/back.png
  20. +2 −0  FRShutterViewControllerDemo/en.lproj/InfoPlist.strings
  21. +18 −0 FRShutterViewControllerDemo/main.m
  22. BIN  FRShutterViewControllerDemo/mandel.jpg
View
486 FRShutterViewController.xcodeproj/project.pbxproj
@@ -0,0 +1,486 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ DAA967ED156150FD00BD5AE4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAA967EC156150FD00BD5AE4 /* Foundation.framework */; };
+ DAA967F3156150FD00BD5AE4 /* FRShutterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA967F2156150FD00BD5AE4 /* FRShutterViewController.m */; };
+ DAA968011561515200BD5AE4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAA968001561515200BD5AE4 /* UIKit.framework */; };
+ DAA968021561515200BD5AE4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAA967EC156150FD00BD5AE4 /* Foundation.framework */; };
+ DAA968041561515200BD5AE4 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAA968031561515200BD5AE4 /* CoreGraphics.framework */; };
+ DAA9680A1561515200BD5AE4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DAA968081561515200BD5AE4 /* InfoPlist.strings */; };
+ DAA9680C1561515200BD5AE4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA9680B1561515200BD5AE4 /* main.m */; };
+ DAA968101561515200BD5AE4 /* FRAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA9680F1561515200BD5AE4 /* FRAppDelegate.m */; };
+ DAA968141561517400BD5AE4 /* libFRShutterViewController.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAA967E9156150FD00BD5AE4 /* libFRShutterViewController.a */; };
+ DAA96822156151B200BD5AE4 /* libFRLayeredNavigationController.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAA9681F156151A900BD5AE4 /* libFRLayeredNavigationController.a */; };
+ DAA9683C1561549100BD5AE4 /* FRShutterDecorationViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = DAA9683A1561549100BD5AE4 /* FRShutterDecorationViewController.h */; };
+ DAA9683D1561549100BD5AE4 /* FRShutterDecorationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA9683B1561549100BD5AE4 /* FRShutterDecorationViewController.m */; };
+ DAA968441561580200BD5AE4 /* back.png in Resources */ = {isa = PBXBuildFile; fileRef = DAA9683E1561580200BD5AE4 /* back.png */; };
+ DAA968451561580200BD5AE4 /* mandel.jpg in Resources */ = {isa = PBXBuildFile; fileRef = DAA9683F1561580200BD5AE4 /* mandel.jpg */; };
+ DAA968461561580200BD5AE4 /* SampleContentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA968411561580200BD5AE4 /* SampleContentViewController.m */; };
+ DAA968471561580200BD5AE4 /* SampleListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA968431561580200BD5AE4 /* SampleListViewController.m */; };
+ DAA9684B15615E6C00BD5AE4 /* FRShutterDecorationView.h in Headers */ = {isa = PBXBuildFile; fileRef = DAA9684915615E6C00BD5AE4 /* FRShutterDecorationView.h */; };
+ DAA9684C15615E6C00BD5AE4 /* FRShutterDecorationView.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA9684A15615E6C00BD5AE4 /* FRShutterDecorationView.m */; };
+ DAA9684F156165C800BD5AE4 /* UIViewController+FRShutterViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = DAA9684D156165C800BD5AE4 /* UIViewController+FRShutterViewController.h */; };
+ DAA96850156165C800BD5AE4 /* UIViewController+FRShutterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA9684E156165C800BD5AE4 /* UIViewController+FRShutterViewController.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ DAA9681E156151A900BD5AE4 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = DAA96815156151A900BD5AE4 /* FRLayeredNavigationController.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = DA4FACC615591AB300D85A7E;
+ remoteInfo = FRLayeredNavigationController;
+ };
+ DAA96820156151A900BD5AE4 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = DAA96815156151A900BD5AE4 /* FRLayeredNavigationController.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = DA4FAD0215591BD500D85A7E;
+ remoteInfo = FRLayeredNavigationControllerDemo;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ DAA967E9156150FD00BD5AE4 /* libFRShutterViewController.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFRShutterViewController.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ DAA967EC156150FD00BD5AE4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ DAA967F0156150FD00BD5AE4 /* FRShutterViewController-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FRShutterViewController-Prefix.pch"; sourceTree = "<group>"; };
+ DAA967F1156150FD00BD5AE4 /* FRShutterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FRShutterViewController.h; sourceTree = "<group>"; };
+ DAA967F2156150FD00BD5AE4 /* FRShutterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FRShutterViewController.m; sourceTree = "<group>"; };
+ DAA967FE1561515200BD5AE4 /* FRShutterViewControllerDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FRShutterViewControllerDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ DAA968001561515200BD5AE4 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ DAA968031561515200BD5AE4 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ DAA968071561515200BD5AE4 /* FRShutterViewControllerDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FRShutterViewControllerDemo-Info.plist"; sourceTree = "<group>"; };
+ DAA968091561515200BD5AE4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ DAA9680B1561515200BD5AE4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ DAA9680D1561515200BD5AE4 /* FRShutterViewControllerDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FRShutterViewControllerDemo-Prefix.pch"; sourceTree = "<group>"; };
+ DAA9680E1561515200BD5AE4 /* FRAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FRAppDelegate.h; sourceTree = "<group>"; };
+ DAA9680F1561515200BD5AE4 /* FRAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FRAppDelegate.m; sourceTree = "<group>"; };
+ DAA96815156151A900BD5AE4 /* FRLayeredNavigationController.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = FRLayeredNavigationController.xcodeproj; path = ../FRLayeredNavigationController/FRLayeredNavigationController.xcodeproj; sourceTree = "<group>"; };
+ DAA9683A1561549100BD5AE4 /* FRShutterDecorationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FRShutterDecorationViewController.h; sourceTree = "<group>"; };
+ DAA9683B1561549100BD5AE4 /* FRShutterDecorationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FRShutterDecorationViewController.m; sourceTree = "<group>"; };
+ DAA9683E1561580200BD5AE4 /* back.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = back.png; sourceTree = "<group>"; };
+ DAA9683F1561580200BD5AE4 /* mandel.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = mandel.jpg; sourceTree = "<group>"; };
+ DAA968401561580200BD5AE4 /* SampleContentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleContentViewController.h; sourceTree = "<group>"; };
+ DAA968411561580200BD5AE4 /* SampleContentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleContentViewController.m; sourceTree = "<group>"; };
+ DAA968421561580200BD5AE4 /* SampleListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleListViewController.h; sourceTree = "<group>"; };
+ DAA968431561580200BD5AE4 /* SampleListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleListViewController.m; sourceTree = "<group>"; };
+ DAA9684915615E6C00BD5AE4 /* FRShutterDecorationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FRShutterDecorationView.h; sourceTree = "<group>"; };
+ DAA9684A15615E6C00BD5AE4 /* FRShutterDecorationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FRShutterDecorationView.m; sourceTree = "<group>"; };
+ DAA9684D156165C800BD5AE4 /* UIViewController+FRShutterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+FRShutterViewController.h"; sourceTree = "<group>"; };
+ DAA9684E156165C800BD5AE4 /* UIViewController+FRShutterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+FRShutterViewController.m"; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ DAA967E6156150FD00BD5AE4 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ DAA967ED156150FD00BD5AE4 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ DAA967FB1561515200BD5AE4 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ DAA96822156151B200BD5AE4 /* libFRLayeredNavigationController.a in Frameworks */,
+ DAA968141561517400BD5AE4 /* libFRShutterViewController.a in Frameworks */,
+ DAA968011561515200BD5AE4 /* UIKit.framework in Frameworks */,
+ DAA968021561515200BD5AE4 /* Foundation.framework in Frameworks */,
+ DAA968041561515200BD5AE4 /* CoreGraphics.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ DAA967DE156150FD00BD5AE4 = {
+ isa = PBXGroup;
+ children = (
+ DAA96815156151A900BD5AE4 /* FRLayeredNavigationController.xcodeproj */,
+ DAA967EE156150FD00BD5AE4 /* FRShutterViewController */,
+ DAA968051561515200BD5AE4 /* FRShutterViewControllerDemo */,
+ DAA967EB156150FD00BD5AE4 /* Frameworks */,
+ DAA967EA156150FD00BD5AE4 /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ DAA967EA156150FD00BD5AE4 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ DAA967E9156150FD00BD5AE4 /* libFRShutterViewController.a */,
+ DAA967FE1561515200BD5AE4 /* FRShutterViewControllerDemo.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ DAA967EB156150FD00BD5AE4 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ DAA967EC156150FD00BD5AE4 /* Foundation.framework */,
+ DAA968001561515200BD5AE4 /* UIKit.framework */,
+ DAA968031561515200BD5AE4 /* CoreGraphics.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ DAA967EE156150FD00BD5AE4 /* FRShutterViewController */ = {
+ isa = PBXGroup;
+ children = (
+ DAA967F1156150FD00BD5AE4 /* FRShutterViewController.h */,
+ DAA967F2156150FD00BD5AE4 /* FRShutterViewController.m */,
+ DAA9683A1561549100BD5AE4 /* FRShutterDecorationViewController.h */,
+ DAA9683B1561549100BD5AE4 /* FRShutterDecorationViewController.m */,
+ DAA9684915615E6C00BD5AE4 /* FRShutterDecorationView.h */,
+ DAA9684A15615E6C00BD5AE4 /* FRShutterDecorationView.m */,
+ DAA9684D156165C800BD5AE4 /* UIViewController+FRShutterViewController.h */,
+ DAA9684E156165C800BD5AE4 /* UIViewController+FRShutterViewController.m */,
+ DAA967EF156150FD00BD5AE4 /* Supporting Files */,
+ );
+ path = FRShutterViewController;
+ sourceTree = "<group>";
+ };
+ DAA967EF156150FD00BD5AE4 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ DAA967F0156150FD00BD5AE4 /* FRShutterViewController-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ DAA968051561515200BD5AE4 /* FRShutterViewControllerDemo */ = {
+ isa = PBXGroup;
+ children = (
+ DAA9680E1561515200BD5AE4 /* FRAppDelegate.h */,
+ DAA9680F1561515200BD5AE4 /* FRAppDelegate.m */,
+ DAA968401561580200BD5AE4 /* SampleContentViewController.h */,
+ DAA968411561580200BD5AE4 /* SampleContentViewController.m */,
+ DAA968421561580200BD5AE4 /* SampleListViewController.h */,
+ DAA968431561580200BD5AE4 /* SampleListViewController.m */,
+ DAA968481561585E00BD5AE4 /* Resources */,
+ DAA968061561515200BD5AE4 /* Supporting Files */,
+ );
+ path = FRShutterViewControllerDemo;
+ sourceTree = "<group>";
+ };
+ DAA968061561515200BD5AE4 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ DAA968071561515200BD5AE4 /* FRShutterViewControllerDemo-Info.plist */,
+ DAA968081561515200BD5AE4 /* InfoPlist.strings */,
+ DAA9680B1561515200BD5AE4 /* main.m */,
+ DAA9680D1561515200BD5AE4 /* FRShutterViewControllerDemo-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ DAA96816156151A900BD5AE4 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ DAA9681F156151A900BD5AE4 /* libFRLayeredNavigationController.a */,
+ DAA96821156151A900BD5AE4 /* FRLayeredNavigationControllerDemo.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ DAA968481561585E00BD5AE4 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ DAA9683E1561580200BD5AE4 /* back.png */,
+ DAA9683F1561580200BD5AE4 /* mandel.jpg */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ DAA967E7156150FD00BD5AE4 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ DAA9683C1561549100BD5AE4 /* FRShutterDecorationViewController.h in Headers */,
+ DAA9684B15615E6C00BD5AE4 /* FRShutterDecorationView.h in Headers */,
+ DAA9684F156165C800BD5AE4 /* UIViewController+FRShutterViewController.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ DAA967E8156150FD00BD5AE4 /* FRShutterViewController */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = DAA967F6156150FD00BD5AE4 /* Build configuration list for PBXNativeTarget "FRShutterViewController" */;
+ buildPhases = (
+ DAA967E5156150FD00BD5AE4 /* Sources */,
+ DAA967E6156150FD00BD5AE4 /* Frameworks */,
+ DAA967E7156150FD00BD5AE4 /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = FRShutterViewController;
+ productName = FRShutterViewController;
+ productReference = DAA967E9156150FD00BD5AE4 /* libFRShutterViewController.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ DAA967FD1561515200BD5AE4 /* FRShutterViewControllerDemo */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = DAA968111561515200BD5AE4 /* Build configuration list for PBXNativeTarget "FRShutterViewControllerDemo" */;
+ buildPhases = (
+ DAA967FA1561515200BD5AE4 /* Sources */,
+ DAA967FB1561515200BD5AE4 /* Frameworks */,
+ DAA967FC1561515200BD5AE4 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = FRShutterViewControllerDemo;
+ productName = FRShutterViewControllerDemo;
+ productReference = DAA967FE1561515200BD5AE4 /* FRShutterViewControllerDemo.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ DAA967E0156150FD00BD5AE4 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0430;
+ };
+ buildConfigurationList = DAA967E3156150FD00BD5AE4 /* Build configuration list for PBXProject "FRShutterViewController" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = DAA967DE156150FD00BD5AE4;
+ productRefGroup = DAA967EA156150FD00BD5AE4 /* Products */;
+ projectDirPath = "";
+ projectReferences = (
+ {
+ ProductGroup = DAA96816156151A900BD5AE4 /* Products */;
+ ProjectRef = DAA96815156151A900BD5AE4 /* FRLayeredNavigationController.xcodeproj */;
+ },
+ );
+ projectRoot = "";
+ targets = (
+ DAA967E8156150FD00BD5AE4 /* FRShutterViewController */,
+ DAA967FD1561515200BD5AE4 /* FRShutterViewControllerDemo */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXReferenceProxy section */
+ DAA9681F156151A900BD5AE4 /* libFRLayeredNavigationController.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libFRLayeredNavigationController.a;
+ remoteRef = DAA9681E156151A900BD5AE4 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ DAA96821156151A900BD5AE4 /* FRLayeredNavigationControllerDemo.app */ = {
+ isa = PBXReferenceProxy;
+ fileType = wrapper.application;
+ path = FRLayeredNavigationControllerDemo.app;
+ remoteRef = DAA96820156151A900BD5AE4 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+/* End PBXReferenceProxy section */
+
+/* Begin PBXResourcesBuildPhase section */
+ DAA967FC1561515200BD5AE4 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ DAA9680A1561515200BD5AE4 /* InfoPlist.strings in Resources */,
+ DAA968441561580200BD5AE4 /* back.png in Resources */,
+ DAA968451561580200BD5AE4 /* mandel.jpg in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ DAA967E5156150FD00BD5AE4 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ DAA967F3156150FD00BD5AE4 /* FRShutterViewController.m in Sources */,
+ DAA9683D1561549100BD5AE4 /* FRShutterDecorationViewController.m in Sources */,
+ DAA9684C15615E6C00BD5AE4 /* FRShutterDecorationView.m in Sources */,
+ DAA96850156165C800BD5AE4 /* UIViewController+FRShutterViewController.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ DAA967FA1561515200BD5AE4 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ DAA9680C1561515200BD5AE4 /* main.m in Sources */,
+ DAA968101561515200BD5AE4 /* FRAppDelegate.m in Sources */,
+ DAA968461561580200BD5AE4 /* SampleContentViewController.m in Sources */,
+ DAA968471561580200BD5AE4 /* SampleListViewController.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ DAA968081561515200BD5AE4 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ DAA968091561515200BD5AE4 /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ DAA967F4156150FD00BD5AE4 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ 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_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.1;
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ DAA967F5156150FD00BD5AE4 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ COPY_PHASE_STRIP = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.1;
+ SDKROOT = iphoneos;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ DAA967F7156150FD00BD5AE4 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ DSTROOT = /tmp/FRShutterViewController.dst;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "FRShutterViewController/FRShutterViewController-Prefix.pch";
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ DAA967F8156150FD00BD5AE4 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ DSTROOT = /tmp/FRShutterViewController.dst;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "FRShutterViewController/FRShutterViewController-Prefix.pch";
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ };
+ name = Release;
+ };
+ DAA968121561515200BD5AE4 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "FRShutterViewControllerDemo/FRShutterViewControllerDemo-Prefix.pch";
+ HEADER_SEARCH_PATHS = ../FRLayeredNavigationController/;
+ INFOPLIST_FILE = "FRShutterViewControllerDemo/FRShutterViewControllerDemo-Info.plist";
+ OTHER_LDFLAGS = (
+ "-all_load",
+ "-ObjC",
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = 2;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ DAA968131561515200BD5AE4 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "FRShutterViewControllerDemo/FRShutterViewControllerDemo-Prefix.pch";
+ HEADER_SEARCH_PATHS = ../FRLayeredNavigationController/;
+ INFOPLIST_FILE = "FRShutterViewControllerDemo/FRShutterViewControllerDemo-Info.plist";
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ OTHER_LDFLAGS = (
+ "-all_load",
+ "-ObjC",
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = 2;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ DAA967E3156150FD00BD5AE4 /* Build configuration list for PBXProject "FRShutterViewController" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ DAA967F4156150FD00BD5AE4 /* Debug */,
+ DAA967F5156150FD00BD5AE4 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ DAA967F6156150FD00BD5AE4 /* Build configuration list for PBXNativeTarget "FRShutterViewController" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ DAA967F7156150FD00BD5AE4 /* Debug */,
+ DAA967F8156150FD00BD5AE4 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ DAA968111561515200BD5AE4 /* Build configuration list for PBXNativeTarget "FRShutterViewControllerDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ DAA968121561515200BD5AE4 /* Debug */,
+ DAA968131561515200BD5AE4 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = DAA967E0156150FD00BD5AE4 /* Project object */;
+}
View
13 FRShutterViewController/FRShutterDecorationView.h
@@ -0,0 +1,13 @@
+//
+// FRShutterDecorationView.h
+// FRShutterViewController
+//
+// Created by Johannes Weiß on 5/14/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface FRShutterDecorationView : UIView
+
+@end
View
31 FRShutterViewController/FRShutterDecorationView.m
@@ -0,0 +1,31 @@
+//
+// FRShutterDecorationView.m
+// FRShutterViewController
+//
+// Created by Johannes Weiß on 5/14/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import "FRShutterDecorationView.h"
+
+@implementation FRShutterDecorationView
+
+- (id)initWithFrame:(CGRect)frame
+{
+ self = [super initWithFrame:frame];
+ if (self) {
+ self.backgroundColor = [UIColor redColor];
+ }
+ return self;
+}
+
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect
+{
+ // Drawing code
+}
+*/
+
+@end
View
24 FRShutterViewController/FRShutterDecorationViewController.h
@@ -0,0 +1,24 @@
+//
+// FRShutterController.h
+// FRShutterViewController
+//
+// Created by Johannes Weiß on 5/14/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class FRShutterDecorationView;
+
+@interface FRShutterDecorationViewController : UIViewController {
+ UIViewController *_contentViewController;
+ FRShutterDecorationView *_decorationView;
+}
+
+- (id)initWithContentViewController:(UIViewController *)vc;
+- (CGPoint)originMin;
+- (CGPoint)originMax;
+
+@property (nonatomic, readonly, strong) FRShutterDecorationView *decorationView;
+
+@end
View
235 FRShutterViewController/FRShutterDecorationViewController.m
@@ -0,0 +1,235 @@
+//
+// FRShutterController.m
+// FRShutterViewController
+//
+// Created by Johannes Weiß on 5/14/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <QuartzCore/QuartzCore.h>
+#import "FRShutterDecorationViewController.h"
+#import "FRShutterDecorationView.h"
+#import "FRShutterViewController.h"
+
+#define FRShutterViewControllerShutterDecorationSize ((CGFloat)44)
+
+@interface FRShutterDecorationViewController ()
+
+@property (nonatomic, readwrite, strong) UIViewController *contentViewController;
+@property (nonatomic, readwrite, strong) FRShutterDecorationView *decorationView;
+
+@end
+
+@implementation FRShutterDecorationViewController
+
+#pragma mark - init/dealloc
+
+- (id)initWithContentViewController:(UIViewController *)vc {
+ if ((self = [super init])) {
+ NSAssert(vc != nil, @"FRShutterDecorationViewController: content view controller is nil");
+ _contentViewController = vc;
+
+ [self attachContentViewController];
+ }
+
+ return self;
+}
+
+- (void)dealloc
+{
+ [self detachContentViewController];
+}
+
+#pragma mark - internal methods
+
+- (FRShutterViewController *)shutterViewController
+{
+ UIViewController *parent = self.parentViewController;
+ NSAssert([parent class] == [FRShutterViewController class], @"FRShutterDecorationViewController's parent wrong");
+ return (FRShutterViewController *)parent;
+}
+
+- (CGRect)decorationFrame
+{
+ FRShutterViewController *svc = [self shutterViewController];
+ const CGSize allSize = self.view.frame.size;
+
+ switch(svc.orientation + (10 * svc.spineLocation)) {
+ case FRShutterViewControllerOrientationHorizontal + 10 * FRShutterViewControllerSpineLocationMin: {
+ return CGRectMake(allSize.width - FRShutterViewControllerShutterDecorationSize,
+ 0,
+ FRShutterViewControllerShutterDecorationSize,
+ allSize.height);
+ }
+ case FRShutterViewControllerOrientationHorizontal + 10 * FRShutterViewControllerSpineLocationMax: {
+ return CGRectMake(0,
+ 0,
+ FRShutterViewControllerShutterDecorationSize,
+ allSize.height);
+ }
+ case FRShutterViewControllerOrientationVertical + 10 * FRShutterViewControllerSpineLocationMin: {
+ return CGRectMake(0,
+ allSize.height - FRShutterViewControllerShutterDecorationSize,
+ allSize.width,
+ FRShutterViewControllerShutterDecorationSize);
+ }
+ case FRShutterViewControllerOrientationVertical + 10 * FRShutterViewControllerSpineLocationMax: {
+ return CGRectMake(0,
+ 0,
+ allSize.width,
+ FRShutterViewControllerShutterDecorationSize);
+ }
+ default:
+ NSAssert(false, @"decorationFrame: unknown orientation / spine location");
+ }
+ return CGRectZero;
+}
+
+- (CGRect)contentFrame
+{
+ FRShutterViewController *svc = [self shutterViewController];
+ const CGSize allSize = self.view.frame.size;
+
+ switch(svc.orientation + (10 * svc.spineLocation)) {
+ case FRShutterViewControllerOrientationHorizontal + 10 * FRShutterViewControllerSpineLocationMin: {
+ return CGRectMake(0,
+ 0,
+ allSize.width - FRShutterViewControllerShutterDecorationSize,
+ allSize.height);
+ }
+ case FRShutterViewControllerOrientationHorizontal + 10 * FRShutterViewControllerSpineLocationMax: {
+ return CGRectMake(FRShutterViewControllerShutterDecorationSize,
+ 0,
+ allSize.width - FRShutterViewControllerShutterDecorationSize,
+ allSize.height);
+ }
+ case FRShutterViewControllerOrientationVertical + 10 * FRShutterViewControllerSpineLocationMin: {
+ return CGRectMake(0,
+ 0,
+ allSize.width,
+ allSize.height - FRShutterViewControllerShutterDecorationSize);
+ }
+ case FRShutterViewControllerOrientationVertical + 10 * FRShutterViewControllerSpineLocationMax: {
+ return CGRectMake(0,
+ FRShutterViewControllerShutterDecorationSize,
+ allSize.width,
+ allSize.height - FRShutterViewControllerShutterDecorationSize);
+ }
+ default:
+ NSAssert(false, @"contentFrame: unknown orientation / spine location");
+ }
+ return CGRectZero;
+}
+
+- (CGPoint)originMin
+{
+ FRShutterViewController *svc = [self shutterViewController];
+ const CGSize allSize = self.view.frame.size;
+
+ switch(svc.orientation + (10 * svc.spineLocation)) {
+ case FRShutterViewControllerOrientationHorizontal + 10 * FRShutterViewControllerSpineLocationMin: {
+ return CGPointMake(-allSize.width+FRShutterViewControllerShutterDecorationSize,
+ 0);
+ }
+ case FRShutterViewControllerOrientationHorizontal + 10 * FRShutterViewControllerSpineLocationMax: {
+ return CGPointMake(0,
+ 0);
+ }
+ case FRShutterViewControllerOrientationVertical + 10 * FRShutterViewControllerSpineLocationMin: {
+ return CGPointMake(0,
+ -allSize.height+FRShutterViewControllerShutterDecorationSize);
+ }
+ case FRShutterViewControllerOrientationVertical + 10 * FRShutterViewControllerSpineLocationMax: {
+ return CGPointMake(0,
+ 0);
+ }
+ default:
+ NSAssert(false, @"originMin: unknown orientation / spine location");
+ }
+ return CGPointZero;
+}
+
+- (CGPoint)originMax
+{
+ FRShutterViewController *svc = [self shutterViewController];
+ const CGSize allSize = self.view.frame.size;
+
+ switch(svc.orientation + (10 * svc.spineLocation)) {
+ case FRShutterViewControllerOrientationHorizontal + 10 * FRShutterViewControllerSpineLocationMin: {
+ return CGPointMake(0,
+ 0);
+ }
+ case FRShutterViewControllerOrientationHorizontal + 10 * FRShutterViewControllerSpineLocationMax: {
+ return CGPointMake(allSize.width-FRShutterViewControllerShutterDecorationSize,
+ 0);
+ }
+ case FRShutterViewControllerOrientationVertical + 10 * FRShutterViewControllerSpineLocationMin: {
+ return CGPointMake(0,
+ 0);
+ }
+ case FRShutterViewControllerOrientationVertical + 10 * FRShutterViewControllerSpineLocationMax: {
+ return CGPointMake(0,
+ allSize.height-FRShutterViewControllerShutterDecorationSize);
+ }
+ default:
+ NSAssert(false, @"originMax: unknown orientation / spine location");
+ }
+ return CGPointZero;
+}
+
+- (void)doViewLayout {
+ self.decorationView.frame = [self decorationFrame];
+ self.contentViewController.view.frame = [self contentFrame];
+}
+
+- (void)attachContentViewController
+{
+ [self addChildViewController:self.contentViewController];
+ [self.contentViewController didMoveToParentViewController:self];
+}
+
+- (void)detachContentViewController
+{
+ [self.contentViewController willMoveToParentViewController:nil];
+ [self.contentViewController removeFromParentViewController];
+}
+
+#pragma mark - UIViewController interface methods
+
+- (void)loadView {
+ self.view = [[UIView alloc] init];
+ self.view.backgroundColor = [UIColor whiteColor];
+
+ self.decorationView = [[FRShutterDecorationView alloc] init];
+
+ [self.view addSubview:self.decorationView];
+ [self.view addSubview:self.contentViewController.view];
+}
+
+- (void)viewWillLayoutSubviews {
+ self.view.layer.shadowRadius = 10.0;
+ self.view.layer.shadowOffset = CGSizeMake(-2.0, -3.0);
+ self.view.layer.shadowOpacity = 0.5;
+ self.view.layer.shadowColor = [UIColor blackColor].CGColor;
+ self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds].CGPath;
+
+ [self doViewLayout];
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+ NSLog(@"FRShutterDecorationController (%@): viewDidUnload", self);
+
+ self.decorationView = nil;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return YES;
+}
+
+@synthesize contentViewController = _contentViewController;
+@synthesize decorationView = _decorationView;
+
+@end
View
7 FRShutterViewController/FRShutterViewController-Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'FRShutterViewController' target in the 'FRShutterViewController' project
+//
+
+#ifdef __OBJC__
+ #import <Foundation/Foundation.h>
+#endif
View
46 FRShutterViewController/FRShutterViewController.h
@@ -0,0 +1,46 @@
+//
+// FRShutterViewController.h
+// FRShutterViewController
+//
+// Created by Johannes Weiß on 5/14/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+#import "UIViewController+FRShutterViewController.h"
+
+@class FRShutterDecorationViewController;
+
+typedef enum {
+ FRShutterViewControllerOrientationHorizontal,
+ FRShutterViewControllerOrientationVertical
+} FRShutterViewControllerOrientation;
+
+typedef enum {
+ FRShutterViewControllerSpineLocationMin,
+ FRShutterViewControllerSpineLocationMax
+} FRShutterViewControllerSpineLocation;
+
+@interface FRShutterViewController : UIViewController<UIGestureRecognizerDelegate> {
+ @private
+ UIViewController *_masterViewController;
+ FRShutterDecorationViewController *_shutterDecorationViewController;
+ FRShutterViewControllerOrientation _orientation;
+ UIPanGestureRecognizer *_panGR;
+}
+
+- (id)initWithMasterViewController:(UIViewController *)master
+ shutterOrientation:(FRShutterViewControllerOrientation)orientation
+ spineLocation:(FRShutterViewControllerSpineLocation)spineLocation;
+
+- (void)openDetailViewController:(UIViewController *)vc animated:(BOOL)animated;
+
+- (void)closeDetailViewControllerAnimated:(BOOL)animated;
+
+@property (nonatomic, readonly) FRShutterViewControllerOrientation orientation;
+@property (nonatomic, readonly) FRShutterViewControllerSpineLocation spineLocation;
+@property (nonatomic, readonly, strong) UIViewController *masterViewController;
+
+@end
View
279 FRShutterViewController/FRShutterViewController.m
@@ -0,0 +1,279 @@
+//
+// FRShutterViewController.m
+// FRShutterViewController
+//
+// Created by Johannes Weiß on 5/14/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "FRShutterViewController.h"
+#import "FRShutterDecorationViewController.h"
+#import "FRShutterDecorationView.h"
+
+@interface FRShutterViewController ()
+
+@property (nonatomic, readwrite, strong) FRShutterDecorationViewController *shutterDecorationViewController;
+@property (nonatomic, readwrite, strong) UIPanGestureRecognizer *panGR;
+
+@end
+
+@implementation FRShutterViewController
+
+#pragma mark - init/dealloc
+
+- (id)initWithMasterViewController:(UIViewController *)master
+ shutterOrientation:(FRShutterViewControllerOrientation)orientation
+ spineLocation:(FRShutterViewControllerSpineLocation)spineLocation
+{
+ if ((self = [super init])) {
+ _masterViewController = master;
+ _orientation = orientation;
+ _spineLocation = spineLocation;
+ }
+
+ [self attachMasterViewController];
+
+ return self;
+}
+
+- (void)dealloc
+{
+ self.panGR.delegate = nil;
+ [self detachMasterViewController];
+}
+
+#pragma mark - internal methods: add/remove master view controller
+
+- (void)attachMasterViewController
+{
+ [self addChildViewController:self.masterViewController];
+ [self.masterViewController didMoveToParentViewController:self];
+}
+
+- (void)detachMasterViewController
+{
+ [self.masterViewController willMoveToParentViewController:nil];
+ [self.masterViewController removeFromParentViewController];
+}
+
+#pragma mark - UIViewController interface
+
+- (void)loadView
+{
+ self.view = [[UIView alloc] init];
+ self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+ self.masterViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+ [self.view addSubview:self.masterViewController.view];
+}
+
+- (void)viewDidLoad
+{
+ self.view.backgroundColor = [UIColor blueColor];
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return YES;
+}
+
+- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)orientation
+{
+ if (self.shutterDecorationViewController != nil) {
+ CGRect f = self.shutterDecorationViewController.view.frame;
+ f.size = self.view.bounds.size;
+ self.shutterDecorationViewController.view.frame = f; /* don't remove this line! */
+ f.origin = [self.shutterDecorationViewController originMin];
+ self.shutterDecorationViewController.view.frame = f;
+ }
+}
+
+#pragma mark - internal helper methods
+
+- (CGPoint)offscreenOrigin {
+ if (self.orientation == FRShutterViewControllerOrientationHorizontal) {
+ if (self.spineLocation == FRShutterViewControllerSpineLocationMin) {
+ return CGPointMake(-1024, 0);
+ } else if (self.spineLocation == FRShutterViewControllerSpineLocationMax) {
+ return CGPointMake(1024, 0);
+ }
+ } else if (self.orientation == FRShutterViewControllerOrientationVertical) {
+ if (self.spineLocation == FRShutterViewControllerSpineLocationMin) {
+ return CGPointMake(0, -1024);
+ } else if (self.spineLocation == FRShutterViewControllerSpineLocationMax) {
+ return CGPointMake(0, 1024);
+ }
+ }
+
+ NSAssert(false, @"BUG: unknown orientation / spine location");
+ return CGPointZero;
+}
+
+#pragma mark - UIGestureRecognizer delegate interface
+
+- (void)handleGesture:(UIPanGestureRecognizer *)g
+{
+ UIView *v = self.shutterDecorationViewController.view;
+ CGRect f = v.frame;
+
+ switch (g.state) {
+ case UIGestureRecognizerStatePossible: {
+ NSLog(@"UIGestureRecognizerStatePossible");
+ break;
+ }
+
+ case UIGestureRecognizerStateBegan: {
+ NSLog(@"UIGestureRecognizerStateBegan");
+ break;
+ }
+
+ case UIGestureRecognizerStateChanged: {
+ NSLog(@"UIGestureRecognizerStateChanged");
+ switch (self.orientation) {
+ case FRShutterViewControllerOrientationHorizontal: {
+ CGFloat xTranslation = [g translationInView:v].x;
+ f.origin.x += xTranslation;
+ v.frame = f;
+ break;
+ }
+ case FRShutterViewControllerOrientationVertical: {
+ CGFloat yTranslation = [g translationInView:v].y;
+ f.origin.y += yTranslation;
+ v.frame = f;
+ break;
+ }
+ default:
+ NSAssert(false, @"unknwon orientation");
+ }
+ [g setTranslation:CGPointZero inView:v];
+ break;
+ }
+
+ case UIGestureRecognizerStateEnded: {
+ NSLog(@"UIGestureRecognizerStateEnded");
+ CGFloat velocity;
+ switch (self.orientation) {
+ case FRShutterViewControllerOrientationHorizontal: {
+ velocity = [g velocityInView:v].x;
+ break;
+ }
+ case FRShutterViewControllerOrientationVertical: {
+ velocity = [g velocityInView:v].y;
+ break;
+ }
+ default:
+ NSAssert(false, @"unknwon orientation");
+ }
+
+ if (abs(velocity) > 100) {
+ if (velocity > 0) {
+ f.origin = [self.shutterDecorationViewController originMax];
+ } else {
+ f.origin = [self.shutterDecorationViewController originMin];
+ }
+ } else {
+ CGPoint min = [self.shutterDecorationViewController originMin];
+ CGPoint max = [self.shutterDecorationViewController originMax];
+ CGPoint cur = f.origin;
+ CGFloat distToMin = sqrt(((min.x-cur.x)*(min.x-cur.x)) + ((min.y-cur.y)*((min.y-cur.y))));
+ CGFloat distToMax = sqrt(((max.x-cur.x)*(max.x-cur.x)) + ((max.y-cur.y)*((max.y-cur.y))));
+
+ if (distToMax < distToMin) {
+ f.origin = [self.shutterDecorationViewController originMax];
+ } else {
+ f.origin = [self.shutterDecorationViewController originMin];
+ }
+ }
+ [UIView animateWithDuration:0.2
+ delay:0.0
+ options:UIViewAnimationCurveEaseOut
+ animations:^{
+ v.frame = f;
+ }
+ completion:^(BOOL finished) {
+ }];
+ break;
+ }
+
+ default:
+ break;
+ }
+}
+
+#pragma mark - Public API
+
+- (void)closeDetailViewControllerAnimated:(BOOL)animated
+{
+ if (self.shutterViewController == nil) {
+ /* nothing to do */
+ return;
+ }
+
+ /* remove old one */
+ FRShutterDecorationViewController *oldVc = self.shutterDecorationViewController;
+ self.shutterDecorationViewController = nil;
+ self.panGR.delegate = nil;
+ self.panGR = nil;
+
+ CGRect f = oldVc.view.frame;
+ f.origin = [self offscreenOrigin];
+ [UIView animateWithDuration:animated ? 0.5 : 0.0
+ animations:^{
+ oldVc.view.frame = f;
+ }
+ completion:^(BOOL finished) {
+ [oldVc willMoveToParentViewController:nil];
+ [oldVc.view removeFromSuperview];
+ [oldVc removeFromParentViewController];
+ }];
+}
+
+- (void)openDetailViewController:(UIViewController *)vc animated:(BOOL)animated
+{
+ if (self.shutterDecorationViewController != nil) {
+ [self closeDetailViewControllerAnimated:animated];
+ }
+ NSAssert(self.shutterDecorationViewController == nil, @"self.shutterDecorationViewController != nil");
+
+ if (vc == nil) {
+ /* we're done :-) */
+ return;
+ }
+ /* no shutter controller yet, create new one */
+ self.shutterDecorationViewController = [[FRShutterDecorationViewController alloc] initWithContentViewController:vc];
+ [self addChildViewController:self.shutterDecorationViewController];
+ CGPoint offscreenOrigin = [self offscreenOrigin];
+ const CGRect offscreenFrame = CGRectMake(offscreenOrigin.x,
+ offscreenOrigin.y,
+ self.view.bounds.size.width,
+ self.view.bounds.size.height);
+ CGPoint onscreenOrigin;
+ if (self.spineLocation == FRShutterViewControllerSpineLocationMin) {
+ onscreenOrigin = [self.shutterDecorationViewController originMax];
+ } else if (self.spineLocation == FRShutterViewControllerSpineLocationMax) {
+ onscreenOrigin = [self.shutterDecorationViewController originMin];
+ } else {
+ NSAssert(false, @"unknown spine location");
+ }
+ const CGRect onscreenFrame = CGRectMake(onscreenOrigin.x, onscreenOrigin.y, self.view.bounds.size.width, self.view.bounds.size.height);
+ self.shutterDecorationViewController.view.frame = offscreenFrame;
+ [self.view addSubview:self.shutterDecorationViewController.view];
+
+ [UIView animateWithDuration:animated ? 0.5 : 0.0
+ animations:^{
+ self.shutterDecorationViewController.view.frame = onscreenFrame;
+ }
+ completion:^(BOOL finished) {
+ self.panGR = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)];
+ [self.shutterDecorationViewController.decorationView addGestureRecognizer:self.panGR];
+ [self.shutterDecorationViewController didMoveToParentViewController:self];
+ }];
+}
+
+@synthesize orientation = _orientation;
+@synthesize spineLocation = _spineLocation;
+@synthesize masterViewController = _masterViewController;
+@synthesize shutterDecorationViewController = _shutterDecorationViewController;
+@synthesize panGR = _panGR;
+
+@end
View
17 FRShutterViewController/UIViewController+FRShutterViewController.h
@@ -0,0 +1,17 @@
+//
+// UIViewController+FRShutterViewController.h
+// FRShutterViewController
+//
+// Created by Johannes Weiß on 5/14/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class FRShutterViewController;
+
+@interface UIViewController (FRShutterViewController)
+
+- (FRShutterViewController *)shutterViewController;
+
+@end
View
29 FRShutterViewController/UIViewController+FRShutterViewController.m
@@ -0,0 +1,29 @@
+//
+// UIViewController+FRShutterViewController.m
+// FRShutterViewController
+//
+// Created by Johannes Weiß on 5/14/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import "UIViewController+FRShutterViewController.h"
+
+#import "FRShutterViewController.h"
+
+@implementation UIViewController (FRShutterViewController)
+
+- (FRShutterViewController *)shutterViewController {
+ UIViewController *here = self;
+
+ while (here != nil) {
+ if([here class] == [FRShutterViewController class]) {
+ return (FRShutterViewController *)here;
+ }
+
+ here = here.parentViewController;
+ }
+
+ return nil;
+}
+
+@end
View
15 FRShutterViewControllerDemo/FRAppDelegate.h
@@ -0,0 +1,15 @@
+//
+// FRAppDelegate.h
+// FRShutterViewControllerDemo
+//
+// Created by Johannes Weiß on 5/14/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface FRAppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
View
65 FRShutterViewControllerDemo/FRAppDelegate.m
@@ -0,0 +1,65 @@
+//
+// FRAppDelegate.m
+// FRShutterViewControllerDemo
+//
+// Created by Johannes Weiß on 5/14/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <FRLayeredNavigationController/FRLayeredNavigation.h>
+
+#import "FRAppDelegate.h"
+#import "SampleContentViewController.h"
+#import "SampleListViewController.h"
+#import "FRShutterViewController.h"
+
+@implementation FRAppDelegate
+
+@synthesize window = _window;
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+
+ SampleListViewController *slvc1 = [[SampleListViewController alloc] init];
+ FRLayeredNavigationController *lnc1 = [[FRLayeredNavigationController alloc]
+ initWithRootViewController:slvc1];
+ FRShutterViewController *svc =
+ [[FRShutterViewController alloc] initWithMasterViewController:lnc1
+ shutterOrientation:FRShutterViewControllerOrientationHorizontal
+ spineLocation:FRShutterViewControllerSpineLocationMax];
+ svc.view.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];
+
+ self.window.rootViewController = svc;
+ [self.window makeKeyAndVisible];
+ 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:.
+}
+
+@end
View
39 FRShutterViewControllerDemo/FRShutterViewControllerDemo-Info.plist
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>de.tux4u.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
View
14 FRShutterViewControllerDemo/FRShutterViewControllerDemo-Prefix.pch
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'FRShutterViewControllerDemo' target in the 'FRShutterViewControllerDemo' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_3_0
+#warning "This project uses features only available in iOS SDK 3.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
View
29 FRShutterViewControllerDemo/SampleContentViewController.h
@@ -0,0 +1,29 @@
+/* This file is part of FRLayeredNavigationController.
+ *
+ * FRLayeredNavigationController is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * FRLayeredNavigationController is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with FRLayeredNavigationController. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * Copyright (c) 2012, Johannes Weiß <weiss@tux4u.de> for factis research GmbH.
+ */
+
+#import <UIKit/UIKit.h>
+
+@interface SampleContentViewController : UIViewController<UIScrollViewDelegate> {
+ UIImageView *imageView;
+ UIScrollView *scrollView;
+}
+
+- (void)indexDidChangeForSegmentedControl:(UISegmentedControl *)sc;
+
+@end
View
129 FRShutterViewControllerDemo/SampleContentViewController.m
@@ -0,0 +1,129 @@
+/* This file is part of FRLayeredNavigationController.
+ *
+ * FRLayeredNavigationController is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * FRLayeredNavigationController is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with FRLayeredNavigationController. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * Copyright (c) 2012, Johannes Weiß <weiss@tux4u.de> for factis research GmbH.
+ */
+
+#import "SampleContentViewController.h"
+
+#import <FRLayeredNavigationController/FRLayeredNavigation.h>
+
+@interface SampleContentViewController ()
+
+@property (nonatomic, readwrite, strong) UIImageView *imageView;
+@property (nonatomic, readwrite, strong) UIScrollView *scrollView;
+
+@end
+
+@implementation SampleContentViewController
+
+- (void)hooray
+{
+ NSLog(@"hooray");
+}
+
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+ if (self) {
+ }
+ return self;
+}
+
+-(UIView *) viewForZoomingInScrollView:(UIScrollView *)inScroll {
+ return self.imageView;
+}
+
+- (void)loadView
+{
+ self.view = [[UIView alloc] init];
+
+ NSBundle *bundle = [NSBundle mainBundle];
+ NSString *path = [bundle pathForResource:@"mandel" ofType:@"jpg"];
+ UIImage *img = [UIImage imageWithContentsOfFile:path];
+ self.imageView = [[UIImageView alloc] initWithImage:img];
+
+ self.scrollView = [[UIScrollView alloc] init];
+ self.scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+ self.scrollView.maximumZoomScale = 10;
+ self.scrollView.minimumZoomScale = 1;
+ self.scrollView.backgroundColor = [UIColor blueColor];
+ self.scrollView.clipsToBounds = YES;
+ self.scrollView.delegate = self;
+ [self.scrollView addSubview:self.imageView];
+ self.scrollView.zoomScale = .37;
+
+ [self.view addSubview:self.scrollView];
+
+ UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(10, 10, 400, 40)];
+ [self.view addSubview:slider];
+}
+
+- (void)viewWillLayoutSubviews {
+ scrollView.contentSize = CGSizeMake(self.view.bounds.size.width, self.view.bounds.size.height);
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+ self.layeredNavigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]
+ initWithImage:[UIImage imageNamed:@"back.png"]
+ style:UIBarButtonItemStylePlain
+ target:self
+ action:@selector(hooray)];
+ self.layeredNavigationItem.leftBarButtonItem.style = UIBarButtonItemStyleBordered;
+ self.layeredNavigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
+ initWithImage:[UIImage imageNamed:@"back.png"]
+ style:UIBarButtonItemStylePlain
+ target:self
+ action:@selector(hooray)];
+ self.layeredNavigationItem.rightBarButtonItem.style = UIBarButtonItemStyleBordered;
+}
+
+- (void)didMoveToParentViewController:(UIViewController *)parent {
+ if (parent == nil) {
+ self.scrollView.delegate = nil;
+ }
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+ // Do any additional setup after loading the view.
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+
+ self.scrollView.delegate = nil;
+ self.scrollView = nil;
+ self.imageView = nil;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return YES;
+}
+
+- (void)indexDidChangeForSegmentedControl:(UISegmentedControl *)sc
+{
+ NSLog(@"SC changed");
+}
+
+@synthesize imageView;
+@synthesize scrollView;
+
+@end
View
24 FRShutterViewControllerDemo/SampleListViewController.h
@@ -0,0 +1,24 @@
+/* This file is part of FRLayeredNavigationController.
+ *
+ * FRLayeredNavigationController is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * FRLayeredNavigationController is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with FRLayeredNavigationController. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * Copyright (c) 2012, Johannes Weiß <weiss@tux4u.de> for factis research GmbH.
+ */
+
+#import <UIKit/UIKit.h>
+
+@interface SampleListViewController : UITableViewController
+
+@end
View
249 FRShutterViewControllerDemo/SampleListViewController.m
@@ -0,0 +1,249 @@
+/* This file is part of FRLayeredNavigationController.
+ *
+ * FRLayeredNavigationController is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * FRLayeredNavigationController is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with FRLayeredNavigationController. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * Copyright (c) 2012, Johannes Weiß <weiss@tux4u.de> for factis research GmbH.
+ */
+
+#import "SampleListViewController.h"
+#import "SampleContentViewController.h"
+
+#import <FRLayeredNavigationController/FRLayeredNavigation.h>
+#import "FRShutterViewController.h"
+
+@interface SampleListViewController ()
+
+@end
+
+@implementation SampleListViewController
+
+- (id)initWithStyle:(UITableViewStyle)style
+{
+ self = [super initWithStyle:style];
+ if (self) {
+ self.title = @"demo";
+ }
+ return self;
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ // Uncomment the following line to preserve selection between presentations.
+ // self.clearsSelectionOnViewWillAppear = NO;
+
+ // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
+ // self.navigationItem.rightBarButtonItem = self.editButtonItem;
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+- (void)hooray
+{
+ NSLog(@"hooray");
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+ self.layeredNavigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]
+ initWithImage:[UIImage imageNamed:@"back.png"]
+ style:UIBarButtonItemStylePlain
+ target:self
+ action:@selector(hooray)];
+ self.layeredNavigationItem.leftBarButtonItem.style = UIBarButtonItemStyleBordered;
+ self.layeredNavigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
+ initWithImage:[UIImage imageNamed:@"back.png"]
+ style:UIBarButtonItemStylePlain
+ target:self
+ action:@selector(hooray)];
+ self.layeredNavigationItem.rightBarButtonItem.style = UIBarButtonItemStyleBordered;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return YES;
+}
+
+#pragma mark - Table view data source
+
+- (NSString *)cellText:(NSInteger)n {
+ if (n < 0) {
+ return @"iOS stinkt";
+ } else if (n == 0) {
+ return @"content (ANIMATION)";
+ } else if (n == 1) {
+ return @"content chromeless (NO ANIMATION)";
+ } else if (n == 2) {
+ return @"open shutter (ANIMATION)";
+ } else if (n == 3) {
+ return @"open shutter (NO ANIMATION)";
+ } else if (n == 4) {
+ return @"close shutter (ANIMATION)";
+ } else if (n == 5) {
+ return @"close shutter (NO ANIMATION)";
+ } else if (n == 6) {
+ return @"foo";
+ } else if (n == 7) {
+ return @"bar";
+ } else if (n == 8) {
+ return @"buz";
+ } else {
+ NSMutableString *s = [[NSMutableString alloc] initWithCapacity:n];
+ [s appendString:@"q"];
+ for (int i=8; i<n; i++) {
+ [s appendString:@"u"];
+ }
+ [s appendString:@"x"];
+ return s;
+ }
+}
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+ return 1;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+ return 106;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ static NSString *CellIdentifier = @"Cell";
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
+
+ if (cell == nil) {
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
+ }
+
+ cell.textLabel.text = [self cellText:indexPath.row];
+ return cell;
+}
+
+/*
+ // Override to support conditional editing of the table view.
+ - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
+ {
+ // Return NO if you do not want the specified item to be editable.
+ return YES;
+ }
+ */
+
+/*
+ // Override to support editing the table view.
+ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
+ {
+ if (editingStyle == UITableViewCellEditingStyleDelete) {
+ // Delete the row from the data source
+ [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
+ }
+ else if (editingStyle == UITableViewCellEditingStyleInsert) {
+ // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
+ }
+ }
+ */
+
+/*
+ // Override to support rearranging the table view.
+ - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
+ {
+ }
+ */
+
+/*
+ // Override to support conditional rearranging of the table view.
+ - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
+ {
+ // Return NO if you do not want the item to be re-orderable.
+ return YES;
+ }
+ */
+
+#pragma mark - Table view delegate
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ UIViewController *svc = nil;
+ NSString *title = [NSString stringWithFormat:@"%@ : %@", self.title, [self cellText:indexPath.row]];
+
+ if (indexPath.row == 0) {
+ /* push a content view controller */
+ svc = [[SampleContentViewController alloc] init];
+ svc.title = title;
+ [self.layeredNavigationController pushViewController:svc
+ inFrontOf:self
+ maximumWidth:YES
+ animated:YES
+ configuration:^(FRLayeredNavigationItem *item) {
+ UISegmentedControl *segControl = [[UISegmentedControl alloc]
+ initWithItems:[NSArray
+ arrayWithObjects:@"foo", @"bar", @"buz", nil]];
+ segControl.segmentedControlStyle = UISegmentedControlStyleBar;
+ segControl.selectedSegmentIndex = 0;
+
+ [segControl addTarget:svc
+ action:@selector(indexDidChangeForSegmentedControl:)
+ forControlEvents:UIControlEventValueChanged];
+
+ item.titleView = segControl;
+ }];
+ } else if (indexPath.row == 1) {
+ /* push a content view controller */
+ svc = [[SampleContentViewController alloc] init];
+ svc.title = title;
+ [self.layeredNavigationController pushViewController:svc inFrontOf:self maximumWidth:YES animated:NO configuration:^(FRLayeredNavigationItem *item) {
+ item.hasChrome = NO;
+ }];
+ } else if (indexPath.row == 2) {
+ SampleListViewController *vc = [[SampleListViewController alloc] init];
+ FRLayeredNavigationController *lnc = [[FRLayeredNavigationController alloc] initWithRootViewController:vc];
+ [self.shutterViewController openDetailViewController:lnc animated:YES];
+ } else if (indexPath.row == 3) {
+ SampleListViewController *vc = [[SampleListViewController alloc] init];
+ FRLayeredNavigationController *lnc = [[FRLayeredNavigationController alloc] initWithRootViewController:vc];
+ [self.shutterViewController openDetailViewController:lnc animated:NO];
+ } else if (indexPath.row == 4) {
+ [self.shutterViewController openDetailViewController:nil animated:YES];
+ } else if (indexPath.row == 5) {
+ [self.shutterViewController openDetailViewController:nil animated:NO];
+ } else {
+ /* list */
+ svc = [[SampleListViewController alloc] init];
+ svc.title = title;
+ [self.layeredNavigationController pushViewController:svc inFrontOf:self maximumWidth:NO animated:YES configuration:^(FRLayeredNavigationItem *item) {
+ /*
+ item.width = (arc4random() % 200) + 200;
+ if (indexPath.row == 6) {
+ item.nextItemDistance = 2;
+ } else {
+ item.nextItemDistance = (arc4random() % 100) + 40;
+ }
+ */
+ item.width = 200;
+ item.nextItemDistance = 64;
+ item.title = [NSString stringWithFormat:@"%@ (%f)", title, item.width];;
+ return;
+ }];
+ }
+}
+
+@end
View
BIN  FRShutterViewControllerDemo/back.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2  FRShutterViewControllerDemo/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
View
18 FRShutterViewControllerDemo/main.m
@@ -0,0 +1,18 @@
+//
+// main.m
+// FRShutterViewControllerDemo
+//
+// Created by Johannes Weiß on 5/14/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "FRAppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([FRAppDelegate class]));
+ }
+}
View
BIN  FRShutterViewControllerDemo/mandel.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

No commit comments for this range

Something went wrong with that request. Please try again.