Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit.

  • Loading branch information...
commit 463324184a67a7fa24c9207352298e69da0d66b7 0 parents
Tom Adriaenssen authored
12 .gitignore
@@ -0,0 +1,12 @@
+# xcode noise
+build/*
+*.pbxuser
+*.mode1v3
+*.xcworkspace
+xcuserdata
+project.xcworkspace/*
+xcuserdata/*
+
+# osx noise
+.DS_Store
+profile
324 ViewDeckExample.xcodeproj/project.pbxproj
@@ -0,0 +1,324 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ E240A9AC148AB3770077282A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E240A9AB148AB3770077282A /* UIKit.framework */; };
+ E240A9AE148AB3770077282A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E240A9AD148AB3770077282A /* Foundation.framework */; };
+ E240A9B0148AB3770077282A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E240A9AF148AB3770077282A /* CoreGraphics.framework */; };
+ E240A9B6148AB3770077282A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E240A9B4148AB3770077282A /* InfoPlist.strings */; };
+ E240A9B8148AB3770077282A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E240A9B7148AB3770077282A /* main.m */; };
+ E240A9BC148AB3770077282A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E240A9BB148AB3770077282A /* AppDelegate.m */; };
+ E240A9BF148AB3770077282A /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E240A9BE148AB3770077282A /* ViewController.m */; };
+ E240A9C2148AB3770077282A /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E240A9C0148AB3770077282A /* ViewController.xib */; };
+ E240A9CC148AB4B60077282A /* IIViewDeckController.m in Sources */ = {isa = PBXBuildFile; fileRef = E240A9CB148AB4B60077282A /* IIViewDeckController.m */; };
+ E240A9D2148ADC020077282A /* LeftViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E240A9D0148ADC020077282A /* LeftViewController.m */; };
+ E240A9D3148ADC020077282A /* LeftViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E240A9D1148ADC020077282A /* LeftViewController.xib */; };
+ E240A9D7148ADC230077282A /* RightViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E240A9D5148ADC230077282A /* RightViewController.m */; };
+ E240A9D8148ADC230077282A /* RightViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E240A9D6148ADC230077282A /* RightViewController.xib */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ E240A9A7148AB3770077282A /* ViewDeckExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ViewDeckExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ E240A9AB148AB3770077282A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ E240A9AD148AB3770077282A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ E240A9AF148AB3770077282A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ E240A9B3148AB3770077282A /* ViewDeckExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ViewDeckExample-Info.plist"; sourceTree = "<group>"; };
+ E240A9B5148AB3770077282A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ E240A9B7148AB3770077282A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ E240A9B9148AB3770077282A /* ViewDeckExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ViewDeckExample-Prefix.pch"; sourceTree = "<group>"; };
+ E240A9BA148AB3770077282A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ E240A9BB148AB3770077282A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ E240A9BD148AB3770077282A /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
+ E240A9BE148AB3770077282A /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
+ E240A9C1148AB3770077282A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController.xib; sourceTree = "<group>"; };
+ E240A9CA148AB4B60077282A /* IIViewDeckController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IIViewDeckController.h; path = vendor/ViewDeck/IIViewDeckController.h; sourceTree = "<group>"; };
+ E240A9CB148AB4B60077282A /* IIViewDeckController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IIViewDeckController.m; path = vendor/ViewDeck/IIViewDeckController.m; sourceTree = "<group>"; };
+ E240A9CF148ADC020077282A /* LeftViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LeftViewController.h; sourceTree = "<group>"; };
+ E240A9D0148ADC020077282A /* LeftViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LeftViewController.m; sourceTree = "<group>"; };
+ E240A9D1148ADC020077282A /* LeftViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LeftViewController.xib; sourceTree = "<group>"; };
+ E240A9D4148ADC230077282A /* RightViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RightViewController.h; sourceTree = "<group>"; };
+ E240A9D5148ADC230077282A /* RightViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RightViewController.m; sourceTree = "<group>"; };
+ E240A9D6148ADC230077282A /* RightViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RightViewController.xib; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ E240A9A4148AB3770077282A /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ E240A9AC148AB3770077282A /* UIKit.framework in Frameworks */,
+ E240A9AE148AB3770077282A /* Foundation.framework in Frameworks */,
+ E240A9B0148AB3770077282A /* CoreGraphics.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ E240A99C148AB3770077282A = {
+ isa = PBXGroup;
+ children = (
+ E240A9B1148AB3770077282A /* ViewDeckExample */,
+ E240A9AA148AB3770077282A /* Frameworks */,
+ E240A9A8148AB3770077282A /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ E240A9A8148AB3770077282A /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ E240A9A7148AB3770077282A /* ViewDeckExample.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ E240A9AA148AB3770077282A /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ E240A9AB148AB3770077282A /* UIKit.framework */,
+ E240A9AD148AB3770077282A /* Foundation.framework */,
+ E240A9AF148AB3770077282A /* CoreGraphics.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ E240A9B1148AB3770077282A /* ViewDeckExample */ = {
+ isa = PBXGroup;
+ children = (
+ E240A9B2148AB3770077282A /* Supporting Files */,
+ E240A9C8148AB3F70077282A /* vendor */,
+ E240A9BA148AB3770077282A /* AppDelegate.h */,
+ E240A9BB148AB3770077282A /* AppDelegate.m */,
+ E240A9BD148AB3770077282A /* ViewController.h */,
+ E240A9BE148AB3770077282A /* ViewController.m */,
+ E240A9C0148AB3770077282A /* ViewController.xib */,
+ E240A9CF148ADC020077282A /* LeftViewController.h */,
+ E240A9D0148ADC020077282A /* LeftViewController.m */,
+ E240A9D1148ADC020077282A /* LeftViewController.xib */,
+ E240A9D4148ADC230077282A /* RightViewController.h */,
+ E240A9D5148ADC230077282A /* RightViewController.m */,
+ E240A9D6148ADC230077282A /* RightViewController.xib */,
+ );
+ path = ViewDeckExample;
+ sourceTree = "<group>";
+ };
+ E240A9B2148AB3770077282A /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ E240A9B3148AB3770077282A /* ViewDeckExample-Info.plist */,
+ E240A9B4148AB3770077282A /* InfoPlist.strings */,
+ E240A9B7148AB3770077282A /* main.m */,
+ E240A9B9148AB3770077282A /* ViewDeckExample-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ E240A9C8148AB3F70077282A /* vendor */ = {
+ isa = PBXGroup;
+ children = (
+ E240A9C9148AB4000077282A /* ViewDeck */,
+ );
+ name = vendor;
+ sourceTree = "<group>";
+ };
+ E240A9C9148AB4000077282A /* ViewDeck */ = {
+ isa = PBXGroup;
+ children = (
+ E240A9CA148AB4B60077282A /* IIViewDeckController.h */,
+ E240A9CB148AB4B60077282A /* IIViewDeckController.m */,
+ );
+ name = ViewDeck;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ E240A9A6148AB3770077282A /* ViewDeckExample */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = E240A9C5148AB3770077282A /* Build configuration list for PBXNativeTarget "ViewDeckExample" */;
+ buildPhases = (
+ E240A9A3148AB3770077282A /* Sources */,
+ E240A9A4148AB3770077282A /* Frameworks */,
+ E240A9A5148AB3770077282A /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = ViewDeckExample;
+ productName = ViewDeckExample;
+ productReference = E240A9A7148AB3770077282A /* ViewDeckExample.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ E240A99E148AB3770077282A /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0420;
+ ORGANIZATIONNAME = "Adriaenssen BVBA";
+ };
+ buildConfigurationList = E240A9A1148AB3770077282A /* Build configuration list for PBXProject "ViewDeckExample" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = E240A99C148AB3770077282A;
+ productRefGroup = E240A9A8148AB3770077282A /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ E240A9A6148AB3770077282A /* ViewDeckExample */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ E240A9A5148AB3770077282A /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ E240A9B6148AB3770077282A /* InfoPlist.strings in Resources */,
+ E240A9C2148AB3770077282A /* ViewController.xib in Resources */,
+ E240A9D3148ADC020077282A /* LeftViewController.xib in Resources */,
+ E240A9D8148ADC230077282A /* RightViewController.xib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ E240A9A3148AB3770077282A /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ E240A9B8148AB3770077282A /* main.m in Sources */,
+ E240A9BC148AB3770077282A /* AppDelegate.m in Sources */,
+ E240A9BF148AB3770077282A /* ViewController.m in Sources */,
+ E240A9CC148AB4B60077282A /* IIViewDeckController.m in Sources */,
+ E240A9D2148ADC020077282A /* LeftViewController.m in Sources */,
+ E240A9D7148ADC230077282A /* RightViewController.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ E240A9B4148AB3770077282A /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ E240A9B5148AB3770077282A /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ E240A9C0148AB3770077282A /* ViewController.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ E240A9C1148AB3770077282A /* en */,
+ );
+ name = ViewController.xib;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ E240A9C3148AB3770077282A /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_ENABLE_OBJC_ARC = 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_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ E240A9C4148AB3770077282A /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ SDKROOT = iphoneos;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ E240A9C6148AB3770077282A /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "ViewDeckExample/ViewDeckExample-Prefix.pch";
+ INFOPLIST_FILE = "ViewDeckExample/ViewDeckExample-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ E240A9C7148AB3770077282A /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "ViewDeckExample/ViewDeckExample-Prefix.pch";
+ INFOPLIST_FILE = "ViewDeckExample/ViewDeckExample-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ E240A9A1148AB3770077282A /* Build configuration list for PBXProject "ViewDeckExample" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ E240A9C3148AB3770077282A /* Debug */,
+ E240A9C4148AB3770077282A /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ E240A9C5148AB3770077282A /* Build configuration list for PBXNativeTarget "ViewDeckExample" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ E240A9C6148AB3770077282A /* Debug */,
+ E240A9C7148AB3770077282A /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = E240A99E148AB3770077282A /* Project object */;
+}
19 ViewDeckExample/AppDelegate.h
@@ -0,0 +1,19 @@
+//
+// AppDelegate.h
+// ViewDeckExample
+//
+// Created by Tom Adriaenssen on 03/12/11.
+// Copyright (c) 2011 Adriaenssen BVBA. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class ViewController;
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@property (strong, nonatomic) UIViewController *viewController;
+
+@end
80 ViewDeckExample/AppDelegate.m
@@ -0,0 +1,80 @@
+//
+// AppDelegate.m
+// ViewDeckExample
+//
+// Created by Tom Adriaenssen on 03/12/11.
+// Copyright (c) 2011 Adriaenssen BVBA. All rights reserved.
+//
+
+#import "AppDelegate.h"
+
+#import "ViewController.h"
+#import "IIViewDeckController.h"
+#import "LeftViewController.h"
+#import "RightViewController.h"
+
+@implementation AppDelegate
+
+@synthesize window = _window;
+@synthesize viewController = _viewController;
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ // Override point for customization after application launch.
+
+ LeftViewController* leftController = [[LeftViewController alloc] initWithNibName:@"LeftViewController" bundle:nil];
+ RightViewController* rightController = [[RightViewController alloc] initWithNibName:@"RightViewController" bundle:nil];
+
+ ViewController* viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
+ UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:viewController];
+
+ self.viewController = [[IIViewDeckController alloc] initWithCenterViewController:navController
+ leftViewController:leftController
+ rightViewController:rightController];
+
+ self.window.rootViewController = self.viewController;
+ [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
13 ViewDeckExample/LeftViewController.h
@@ -0,0 +1,13 @@
+//
+// LeftViewController.h
+// ViewDeckExample
+//
+// Created by Tom Adriaenssen on 03/12/11.
+// Copyright (c) 2011 Adriaenssen BVBA. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface LeftViewController : UITableViewController
+
+@end
157 ViewDeckExample/LeftViewController.m
@@ -0,0 +1,157 @@
+//
+// LeftViewController.m
+// ViewDeckExample
+//
+// Created by Tom Adriaenssen on 03/12/11.
+// Copyright (c) 2011 Adriaenssen BVBA. All rights reserved.
+//
+
+#import "LeftViewController.h"
+
+@implementation LeftViewController
+
+- (id)initWithStyle:(UITableViewStyle)style
+{
+ self = [super initWithStyle:style];
+ if (self) {
+ // Custom initialization
+ }
+ return self;
+}
+
+- (void)didReceiveMemoryWarning
+{
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Release any cached data, images, etc that aren't in use.
+}
+
+#pragma mark - View lifecycle
+
+- (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)viewWillAppear:(BOOL)animated
+{
+ [super viewWillAppear:animated];
+}
+
+- (void)viewDidAppear:(BOOL)animated
+{
+ [super viewDidAppear:animated];
+}
+
+- (void)viewWillDisappear:(BOOL)animated
+{
+ [super viewWillDisappear:animated];
+}
+
+- (void)viewDidDisappear:(BOOL)animated
+{
+ [super viewDidDisappear:animated];
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ // Return YES for supported orientations
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+
+#pragma mark - Table view data source
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+ return 3 + arc4random() % 5;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+ return 3 + arc4random() % 5;
+}
+
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
+ return [NSString stringWithFormat:@"%d", section];
+}
+
+- (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 = [NSString stringWithFormat:@"%d:%d", indexPath.section, 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
+{
+ // Navigation logic may go here. Create and push another view controller.
+ /*
+ <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
+ // ...
+ // Pass the selected object to the new view controller.
+ [self.navigationController pushViewController:detailViewController animated:YES];
+ */
+}
+
+@end
142 ViewDeckExample/LeftViewController.xib
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
+ <data>
+ <int key="IBDocument.SystemTarget">1280</int>
+ <string key="IBDocument.SystemVersion">11C25</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1919</string>
+ <string key="IBDocument.AppKitVersion">1138.11</string>
+ <string key="IBDocument.HIToolboxVersion">566.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">916</string>
+ </object>
+ <array key="IBDocument.IntegratedClassDependencies">
+ <string>IBProxyObject</string>
+ <string>IBUITableView</string>
+ </array>
+ <array key="IBDocument.PluginDependencies">
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </array>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
+ </object>
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUITableView" id="873029372">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrame">{{0, 20}, {320, 460}}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIBouncesZoom">NO</bool>
+ <int key="IBUISeparatorStyle">1</int>
+ <int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
+ <bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
+ <float key="IBUIRowHeight">44</float>
+ <float key="IBUISectionHeaderHeight">22</float>
+ <float key="IBUISectionFooterHeight">22</float>
+ </object>
+ </array>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <array class="NSMutableArray" key="connectionRecords">
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="873029372"/>
+ </object>
+ <int key="connectionID">5</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">dataSource</string>
+ <reference key="source" ref="873029372"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">6</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="873029372"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">7</int>
+ </object>
+ </array>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <array key="orderedObjects">
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <array key="object" id="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="873029372"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ </array>
+ </object>
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
+ <string key="-1.CustomClassName">LeftViewController</string>
+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="-2.CustomClassName">UIResponder</string>
+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
+ <nil key="activeLocalization"/>
+ <dictionary class="NSMutableDictionary" key="localizations"/>
+ <nil key="sourceID"/>
+ <int key="maxID">7</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">LeftViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/LeftViewController.h</string>
+ </object>
+ </object>
+ </array>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">916</string>
+ </data>
+</archive>
13 ViewDeckExample/RightViewController.h
@@ -0,0 +1,13 @@
+//
+// RightViewController.h
+// ViewDeckExample
+//
+// Created by Tom Adriaenssen on 03/12/11.
+// Copyright (c) 2011 Adriaenssen BVBA. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface RightViewController : UIViewController
+
+@end
51 ViewDeckExample/RightViewController.m
@@ -0,0 +1,51 @@
+//
+// RightViewController.m
+// ViewDeckExample
+//
+// Created by Tom Adriaenssen on 03/12/11.
+// Copyright (c) 2011 Adriaenssen BVBA. All rights reserved.
+//
+
+#import "RightViewController.h"
+
+@implementation RightViewController
+
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+ if (self) {
+ // Custom initialization
+ }
+ return self;
+}
+
+- (void)didReceiveMemoryWarning
+{
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Release any cached data, images, etc that aren't in use.
+}
+
+#pragma mark - View lifecycle
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+ // Do any additional setup after loading the view from its nib.
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ // Return YES for supported orientations
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+
+@end
103 ViewDeckExample/RightViewController.xib
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
+ <data>
+ <int key="IBDocument.SystemTarget">1280</int>
+ <string key="IBDocument.SystemVersion">11C74</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1938</string>
+ <string key="IBDocument.AppKitVersion">1138.23</string>
+ <string key="IBDocument.HIToolboxVersion">567.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">933</string>
+ </object>
+ <array key="IBDocument.IntegratedClassDependencies">
+ <string>IBProxyObject</string>
+ <string>IBUIView</string>
+ </array>
+ <array key="IBDocument.PluginDependencies">
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </array>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
+ </object>
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="191373211">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrame">{{0, 20}, {320, 460}}</string>
+ <reference key="NSSuperview"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MSAwLjQzNTI5NDEyMTUgMC44MTE3NjQ3MTcxAA</bytes>
+ </object>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </array>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <array class="NSMutableArray" key="connectionRecords">
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="191373211"/>
+ </object>
+ <int key="connectionID">3</int>
+ </object>
+ </array>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <array key="orderedObjects">
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <array key="object" id="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="191373211"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ </array>
+ </object>
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
+ <string key="-1.CustomClassName">RightViewController</string>
+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="-2.CustomClassName">UIResponder</string>
+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
+ <nil key="activeLocalization"/>
+ <dictionary class="NSMutableDictionary" key="localizations"/>
+ <nil key="sourceID"/>
+ <int key="maxID">3</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes"/>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">933</string>
+ </data>
+</archive>
13 ViewDeckExample/ViewController.h
@@ -0,0 +1,13 @@
+//
+// ViewController.h
+// ViewDeckExample
+//
+// Created by Tom Adriaenssen on 03/12/11.
+// Copyright (c) 2011 Adriaenssen BVBA. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface ViewController : UIViewController
+
+@end
57 ViewDeckExample/ViewController.m
@@ -0,0 +1,57 @@
+//
+// ViewController.m
+// ViewDeckExample
+//
+// Created by Tom Adriaenssen on 03/12/11.
+// Copyright (c) 2011 Adriaenssen BVBA. All rights reserved.
+//
+
+#import "ViewController.h"
+#import "IIViewDeckController.h"
+
+@implementation ViewController
+
+#pragma mark - View lifecycle
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"left" style:UIBarButtonItemStyleBordered target:self.viewDeckController action:@selector(toggleLeftView)];
+ self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"right" style:UIBarButtonItemStyleBordered target:self.viewDeckController action:@selector(toggleRightView)];
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+ [super viewWillAppear:animated];
+}
+
+- (void)viewDidAppear:(BOOL)animated
+{
+ [super viewDidAppear:animated];
+}
+
+- (void)viewWillDisappear:(BOOL)animated
+{
+ [super viewWillDisappear:animated];
+}
+
+- (void)viewDidDisappear:(BOOL)animated
+{
+ [super viewDidDisappear:animated];
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ // Return YES for supported orientations
+ return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
+}
+
+@end
40 ViewDeckExample/ViewDeckExample-Info.plist
@@ -0,0 +1,40 @@
+<?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>CFBundleIconFiles</key>
+ <array/>
+ <key>CFBundleIdentifier</key>
+ <string>org.inferis.${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</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
14 ViewDeckExample/ViewDeckExample-Prefix.pch
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'ViewDeckExample' target in the 'ViewDeckExample' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_4_0
+#warning "This project uses features only available in iOS SDK 4.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
2  ViewDeckExample/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
119 ViewDeckExample/en.lproj/ViewController.xib
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
+ <data>
+ <int key="IBDocument.SystemTarget">1280</int>
+ <string key="IBDocument.SystemVersion">11C25</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1919</string>
+ <string key="IBDocument.AppKitVersion">1138.11</string>
+ <string key="IBDocument.HIToolboxVersion">566.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">916</string>
+ </object>
+ <array key="IBDocument.IntegratedClassDependencies">
+ <string>IBProxyObject</string>
+ <string>IBUIView</string>
+ </array>
+ <array key="IBDocument.PluginDependencies">
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </array>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
+ </object>
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="843779117">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="774585933">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrame">{{0, 20}, {320, 460}}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC43NQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </array>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <array class="NSMutableArray" key="connectionRecords">
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="774585933"/>
+ </object>
+ <int key="connectionID">7</int>
+ </object>
+ </array>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <array key="orderedObjects">
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <array key="object" id="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="843779117"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="774585933"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ </array>
+ </object>
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
+ <string key="-1.CustomClassName">ViewController</string>
+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="-2.CustomClassName">UIResponder</string>
+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
+ <nil key="activeLocalization"/>
+ <dictionary class="NSMutableDictionary" key="localizations"/>
+ <nil key="sourceID"/>
+ <int key="maxID">7</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">ViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/ViewController.h</string>
+ </object>
+ </object>
+ </array>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">916</string>
+ </data>
+</archive>
18 ViewDeckExample/main.m
@@ -0,0 +1,18 @@
+//
+// main.m
+// ViewDeckExample
+//
+// Created by Tom Adriaenssen on 03/12/11.
+// Copyright (c) 2011 Adriaenssen BVBA. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "AppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
37 ViewDeckExample/vendor/ViewDeck/IIViewDeckController.h
@@ -0,0 +1,37 @@
+//
+// IIViewDeckController.h
+// ViewDeckExample
+//
+// Created by Tom Adriaenssen on 03/12/11.
+// Copyright (c) 2011 Adriaenssen BVBA. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface IIViewDeckController : UIViewController
+
+- (id)initWithCenterViewController:(UIViewController*)centerController;
+- (id)initWithCenterViewController:(UIViewController*)centerController leftViewController:(UIViewController*)leftController;
+- (id)initWithCenterViewController:(UIViewController*)centerController leftViewController:(UIViewController*)leftController rightViewController:(UIViewController*)rightController;
+
+- (void)toggleLeftView;
+- (void)openLeftView;
+- (void)closeLeftView;
+- (void)toggleLeftViewAnimated:(BOOL)animated;
+- (void)openLeftViewAnimated:(BOOL)animated;
+- (void)closeLeftViewAnimated:(BOOL)animated;
+
+- (void)toggleRightView;
+- (void)openRightView;
+- (void)closeRightView;
+- (void)toggleRightViewAnimated:(BOOL)animated;
+- (void)openRightViewAnimated:(BOOL)animated;
+- (void)closeRightViewAnimated:(BOOL)animated;
+
+@end
+
+@interface UIViewController (Stuff)
+
+@property(nonatomic,readonly,retain) IIViewDeckController *viewDeckController; // If this view controller has been pushed onto a navigation controller, return it.
+
+@end
227 ViewDeckExample/vendor/ViewDeck/IIViewDeckController.m
@@ -0,0 +1,227 @@
+//
+// IIViewDeckController.m
+// ViewDeckExample
+//
+// Created by Tom Adriaenssen on 03/12/11.
+// Copyright (c) 2011 Adriaenssen BVBA. All rights reserved.
+//
+
+#import "IIViewDeckController.h"
+#import <objc/runtime.h>
+#import <QuartzCore/QuartzCore.h>
+
+@interface IIViewDeckController () {
+}
+
+@property (nonatomic, retain) UIViewController* centerController;
+@property (nonatomic, retain) UIViewController* leftController;
+@property (nonatomic, retain) UIViewController* rightController;
+//@property (nonatomic, retain) UIViewController* topController;
+//@property (nonatomic, retain) UIViewController* bottomController;
+
+@end
+
+@interface UIViewController (Stuff_Internal)
+
+- (void)setViewDeckController:(IIViewDeckController*)viewDeckController;
+
+@end
+
+@implementation IIViewDeckController
+
+@synthesize centerController = _centerController;
+@synthesize leftController = _leftController;
+@synthesize rightController = _rightController;
+
+#pragma mark - Initalisation and deallocation
+
+- (id)initWithCenterViewController:(UIViewController*)centerController {
+ if ((self = [self init])) {
+ self.centerController = centerController;
+ [self.centerController setViewDeckController:self];
+ self.leftController = nil;
+ self.rightController = nil;
+ }
+ return self;
+}
+
+- (id)initWithCenterViewController:(UIViewController*)centerController leftViewController:(UIViewController*)leftController {
+ if ((self = [self initWithCenterViewController:centerController])) {
+ self.leftController = leftController;
+ [self.leftController setViewDeckController:self];
+ }
+ return self;
+}
+
+- (id)initWithCenterViewController:(UIViewController*)centerController leftViewController:(UIViewController*)leftController rightViewController:(UIViewController*)rightController {
+ if ((self = [self initWithCenterViewController:centerController])) {
+ self.leftController = leftController;
+ [self.leftController setViewDeckController:self];
+
+ self.rightController = rightController;
+ [self.rightController setViewDeckController:self];
+ }
+ return self;
+}
+
+- (void)dealloc {
+ self.centerController.viewDeckController = nil;
+ self.leftController.viewDeckController = nil;
+ self.rightController.viewDeckController = nil;
+}
+
+#pragma mark - Memory management
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+
+ [self.centerController didReceiveMemoryWarning];
+ [self.leftController didReceiveMemoryWarning];
+ [self.rightController didReceiveMemoryWarning];
+}
+
+#pragma mark - View lifecycle
+
+// Implement loadView to create a view hierarchy programmatically, without using a nib.
+- (void)loadView
+{
+ self.view = [[UIView alloc] init];
+
+ [self.view addSubview:self.leftController.view];
+ [self.view addSubview:self.rightController.view];
+ [self.view addSubview:self.centerController.view];
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+
+ [self.centerController.view removeFromSuperview];
+ [self.leftController.view removeFromSuperview];
+ [self.rightController.view removeFromSuperview];
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+ [super viewWillAppear:animated];
+
+ self.centerController.view.frame = self.view.bounds;
+ self.centerController.view.hidden = NO;
+ self.leftController.view.frame = self.view.bounds;
+ self.leftController.view.hidden = YES;
+ self.rightController.view.frame = self.view.bounds;
+ self.rightController.view.hidden = YES;
+
+ self.centerController.view.layer.shadowRadius = 10;
+ self.centerController.view.layer.shadowOpacity = 0.5;
+ self.centerController.view.layer.shadowColor = [[UIColor blackColor] CGColor];
+ self.centerController.view.layer.shadowOffset = CGSizeZero;
+ self.centerController.view.layer.shadowPath = [[UIBezierPath bezierPathWithRect:self.view.bounds] CGPath];
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return [self.centerController shouldAutorotateToInterfaceOrientation:interfaceOrientation];
+ // todo check slidden out controller
+}
+
+#define SLIDE_DURATION(animated) ((animated) ? 0.3 : 0)
+
+- (void)toggleLeftView {
+ [self toggleLeftViewAnimated:YES];
+}
+
+- (void)openLeftView {
+ [self openLeftViewAnimated:YES];
+}
+
+- (void)closeLeftView {
+ [self closeLeftViewAnimated:YES];
+}
+
+- (void)toggleLeftViewAnimated:(BOOL)animated {
+ NSLog(@"left(%@).view.hidden = %d", self.leftController, self.leftController.view.hidden);
+ if (self.leftController.view.hidden)
+ [self openLeftViewAnimated:animated];
+ else
+ [self closeLeftViewAnimated:animated];
+}
+
+- (void)openLeftViewAnimated:(BOOL)animated {
+ [UIView animateWithDuration:SLIDE_DURATION(animated) delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
+ int leftMargin = 44;
+ self.leftController.view.hidden = NO;
+ self.centerController.view.frame = (CGRect) { self.view.bounds.size.width - leftMargin, 0, self.view.bounds.size };
+ } completion:^(BOOL finished) {
+ }];
+}
+
+- (void)closeLeftViewAnimated:(BOOL)animated {
+ [UIView animateWithDuration:SLIDE_DURATION(animated) delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
+ self.centerController.view.frame = self.view.bounds;
+ } completion:^(BOOL finished) {
+ self.leftController.view.hidden = YES;
+ }];
+}
+
+- (void)toggleRightView {
+ [self toggleRightViewAnimated:YES];
+}
+
+- (void)openRightView {
+ [self openRightViewAnimated:YES];
+}
+
+- (void)closeRightView {
+ [self closeRightViewAnimated:YES];
+}
+
+- (void)toggleRightViewAnimated:(BOOL)animated {
+ if (self.rightController.view.hidden)
+ [self openRightViewAnimated:animated];
+ else
+ [self closeRightViewAnimated:animated];
+}
+
+- (void)openRightViewAnimated:(BOOL)animated {
+ [UIView animateWithDuration:SLIDE_DURATION(animated) delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
+ int rightMargin = 44;
+ self.rightController.view.hidden = NO;
+ self.centerController.view.frame = (CGRect) { rightMargin - self.view.bounds.size.width, 0, self.view.bounds.size };
+ } completion:^(BOOL finished) {
+ }];
+}
+
+- (void)closeRightViewAnimated:(BOOL)animated {
+ [UIView animateWithDuration:SLIDE_DURATION(animated) delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
+ self.centerController.view.frame = self.view.bounds;
+ } completion:^(BOOL finished) {
+ self.rightController.view.hidden = YES;
+ }];
+}
+
+@end
+
+
+@implementation UIViewController (Stuff)
+
+@dynamic viewDeckController;
+
+static char* viewDeckControllerKey = "ViewDeckController";
+
+- (IIViewDeckController*)viewDeckController {
+ id result = objc_getAssociatedObject(self, viewDeckControllerKey);
+ if (!result && self.navigationController)
+ return [self.navigationController viewDeckController];
+
+ NSLog(@"Getting view deck controller %@ from object %@ (key = %p)", result, self, viewDeckControllerKey);
+ return result;
+}
+
+- (void)setViewDeckController:(IIViewDeckController*)viewDeckController {
+ NSLog(@"Setting view deck controller %@ on object %@ (key = %p)", viewDeckController, self, viewDeckControllerKey);
+ objc_setAssociatedObject(self, viewDeckControllerKey, viewDeckController, OBJC_ASSOCIATION_RETAIN);
+}
+
+@end
+
Please sign in to comment.
Something went wrong with that request. Please try again.