Permalink
Browse files

Added swapping of a navigation controller to the viewdeckexample.

Demos #4.
  • Loading branch information...
Inferis committed Jan 7, 2012
1 parent c947e5f commit 6a7b81f37166781bcd5e21cdb7d9afcd0f24a33d
@@ -22,6 +22,8 @@
E240A9EC148C51E00077282A /* bg.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E240A9EB148C51E00077282A /* bg.jpg */; };
E25F8B3E14B45F2B00C4182C /* IIViewDeckController.m in Sources */ = {isa = PBXBuildFile; fileRef = E25F8B3B14B45F2B00C4182C /* IIViewDeckController.m */; };
E25F8B3F14B45F2B00C4182C /* WrappedController.m in Sources */ = {isa = PBXBuildFile; fileRef = E25F8B3D14B45F2B00C4182C /* WrappedController.m */; };
+ E2955F9814B7D678003DDB4E /* NestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E2955F9614B7D678003DDB4E /* NestViewController.m */; };
+ E2955F9914B7D678003DDB4E /* NestViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E2955F9714B7D678003DDB4E /* NestViewController.xib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -49,6 +51,9 @@
E25F8B3B14B45F2B00C4182C /* IIViewDeckController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IIViewDeckController.m; sourceTree = "<group>"; };
E25F8B3C14B45F2B00C4182C /* WrappedController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WrappedController.h; sourceTree = "<group>"; };
E25F8B3D14B45F2B00C4182C /* WrappedController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WrappedController.m; sourceTree = "<group>"; };
+ E2955F9514B7D678003DDB4E /* NestViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NestViewController.h; sourceTree = "<group>"; };
+ E2955F9614B7D678003DDB4E /* NestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NestViewController.m; sourceTree = "<group>"; };
+ E2955F9714B7D678003DDB4E /* NestViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NestViewController.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -109,6 +114,9 @@
E240A9D4148ADC230077282A /* RightViewController.h */,
E240A9D5148ADC230077282A /* RightViewController.m */,
E240A9D6148ADC230077282A /* RightViewController.xib */,
+ E2955F9514B7D678003DDB4E /* NestViewController.h */,
+ E2955F9614B7D678003DDB4E /* NestViewController.m */,
+ E2955F9714B7D678003DDB4E /* NestViewController.xib */,
);
path = ViewDeckExample;
sourceTree = "<group>";
@@ -207,6 +215,7 @@
E240A9D8148ADC230077282A /* RightViewController.xib in Resources */,
E240A9E8148C51AC0077282A /* ViewController.xib in Resources */,
E240A9EC148C51E00077282A /* bg.jpg in Resources */,
+ E2955F9914B7D678003DDB4E /* NestViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -224,6 +233,7 @@
E240A9D7148ADC230077282A /* RightViewController.m in Sources */,
E25F8B3E14B45F2B00C4182C /* IIViewDeckController.m in Sources */,
E25F8B3F14B45F2B00C4182C /* WrappedController.m in Sources */,
+ E2955F9814B7D678003DDB4E /* NestViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -0,0 +1,14 @@
+//
+// NestViewController.h
+// ViewDeckExample
+//
+
+#import <UIKit/UIKit.h>
+
+@interface NestViewController : UIViewController
+
+@property (nonatomic, assign) NSInteger level;
+@property (nonatomic, retain) IBOutlet UILabel* levelLabel;
+
+- (IBAction)pressedGoDeeper:(id)sender;
+@end
@@ -0,0 +1,44 @@
+//
+// NestViewController.m
+// ViewDeckExample
+//
+
+#import "NestViewController.h"
+
+@implementation NestViewController
+
+@synthesize level;
+@synthesize levelLabel;
+
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+ if (self) {
+ self.level = 0;
+ }
+ return self;
+}
+
+#pragma mark - View lifecycle
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.levelLabel.text = [NSString stringWithFormat:@"Level %d", self.level];
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ // Return YES for supported orientations
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+
+- (IBAction)pressedGoDeeper:(id)sender {
+ NestViewController* nestController = [[NestViewController alloc] initWithNibName:@"NestViewController" bundle:nil];
+ nestController.level = self.level + 1;
+
+ [self.navigationController pushViewController:nestController animated:YES];
+}
+
+@end
@@ -0,0 +1,209 @@
+<?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>IBUIButton</string>
+ <string>IBUIView</string>
+ <string>IBUILabel</string>
+ <string>IBProxyObject</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>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="IBUILabel" id="675620916">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">290</int>
+ <string key="NSFrame">{{20, 20}, {280, 27}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSNextKeyView" ref="898279842"/>
+ <string key="NSReuseIdentifierKey">_NS:328</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <int key="IBUIContentMode">7</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <string key="IBUIText">Label</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDAAA</bytes>
+ </object>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ <object class="IBUIFontDescription" key="IBUIFontDescription">
+ <int key="type">1</int>
+ <double key="pointSize">28</double>
+ </object>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">28</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ </object>
+ <object class="IBUIButton" id="898279842">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 66}, {144, 37}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSNextKeyView"/>
+ <string key="NSReuseIdentifierKey">_NS:225</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <int key="IBUIButtonType">1</int>
+ <string key="IBUINormalTitle">Go deeper</string>
+ <object class="NSColor" key="IBUIHighlightedTitleColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <object class="NSColor" key="IBUINormalTitleColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+ </object>
+ <object class="NSColor" key="IBUINormalTitleShadowColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC41AA</bytes>
+ </object>
+ <object class="IBUIFontDescription" key="IBUIFontDescription">
+ <int key="type">2</int>
+ <double key="pointSize">15</double>
+ </object>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica-Bold</string>
+ <double key="NSSize">15</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ </object>
+ </array>
+ <string key="NSFrame">{{0, 20}, {320, 460}}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSNextKeyView" ref="675620916"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </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>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">levelLabel</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="675620916"/>
+ </object>
+ <int key="connectionID">5</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">pressedGoDeeper:</string>
+ <reference key="source" ref="898279842"/>
+ <reference key="destination" ref="372490531"/>
+ <int key="IBEventType">7</int>
+ </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="191373211"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="675620916"/>
+ <reference ref="898279842"/>
+ </array>
+ <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>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="675620916"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="898279842"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ </array>
+ </object>
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
+ <string key="-1.CustomClassName">NestViewController</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>
+ <string key="4.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"/>
+ <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>
@@ -11,5 +11,6 @@
- (IBAction)defaultCenterPressed:(id)sender;
- (IBAction)swapLeftAndCenterPressed:(id)sender;
+- (IBAction)centerNavController:(id)sender;
@end
@@ -8,6 +8,7 @@
#import "LeftViewController.h"
#import "ViewController.h"
#import "IIViewDeckController.h"
+#import "NestViewController.h"
@interface RightViewController () <IIViewDeckControllerDelegate>
@@ -58,6 +59,15 @@ - (IBAction)swapLeftAndCenterPressed:(id)sender {
self.viewDeckController.leftController = SharedAppDelegate.centerController;
}
+- (IBAction)centerNavController:(id)sender {
+ self.viewDeckController.leftController = SharedAppDelegate.leftController;
+
+ NestViewController* nestController = [[NestViewController alloc] initWithNibName:@"NestViewController" bundle:nil];
+ UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:nestController];
+ self.viewDeckController.centerController = navController;
+}
+
+
#pragma mark - view deck delegate
- (void)addLog:(NSString*)line {
Oops, something went wrong.

0 comments on commit 6a7b81f

Please sign in to comment.