Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initial commit

  • Loading branch information...
commit 5490ded69d2ad2caa1b5f3e748ef0e462378abd4 1 parent d70cad3
Michael Tyson authored
2  .gitignore
... ... @@ -0,0 +1,2 @@
  1 +.DS_Store
  2 +xcuserdata
58 README.markdown
Source Rendered
... ... @@ -0,0 +1,58 @@
  1 +TPMultiLayoutViewController
  2 +===========================
  3 +
  4 +A drop-in UIViewController subclass that automatically manages switching between different view layouts
  5 +for portrait and landscape orientations, without the need to maintain view state across two different
  6 +view hierarchies.
  7 +
  8 +## The Problem
  9 +
  10 + - You want to support portrait and landscape modes in your app.
  11 + - Having just one view layout for both portrait and landscape doesn't give good results.
  12 +
  13 +## The Conventional Solution: Double Handling
  14 +
  15 + - Create two distinct view hierarchies: one for portrait and one for landscape.
  16 + - On orientation change, set `this.view` to either your portrait view, or your landscape view.
  17 + - On load, perform your initialisation on both views: *Big Overhead*.
  18 + - Whenever your view/app state changes, sync the state across both views: *Big Overhead*.
  19 +
  20 +## An Easier Solution: Layout Templating
  21 +
  22 + - Create two distinct view hierarchies: one for portrait and one for landscape.
  23 + - Extract just the layout information from the two view versions: use the original two view hierarchies as a *layout template*.
  24 + - Maintain one single view hierarchy: no double handling, no state syncing.
  25 + - On orientation change, simply apply the layout information we extracted to our single view hierarchy, to achieve the new layout.
  26 +
  27 +In summary, we skip the double handling by keeping just one view, not two views we need to sync. When the orientation changes, we just
  28 +rearrange the view, using the layout we extracted from our original two views.
  29 +
  30 +## Usage
  31 +
  32 + 1. Set the superclass for your view controller to TPMultiLayoutViewController.
  33 + 2. In Interface Builder, create two different views: one for portrait orientation, and one for landscape orientation.
  34 + 3. Attach your portrait orientation root view to the "portraitView" outlet, and the landscape orientation root view
  35 + to the "landscapeView" outlet.
  36 + 4. Attach one of the views (whichever you prefer) to the "view" outlet, and connect
  37 + any actions and outlets from that view.
  38 +
  39 +## Notes
  40 +
  41 + - Currently, only `frame`, `bounds`, `hidden` and `autoresizingMask` attributes are assigned, but this can be easily extended. See `attributesForView:` and `applyAttributes:toView:` for details.
  42 + - Both layouts should have the same hierarchical structure.
  43 + - Views are matched to their counterparts in the other layout by searching for similarities, in the following order:
  44 + 1. Tag
  45 + 2. Class, target and action (for UIControl)
  46 + 3. Title or image (for UIButton)
  47 + 4. Title (for UILabel)
  48 + 5. Text or placeholder (for UITextField)
  49 + 6. Class
  50 +
  51 + If you experience odd behaviour, check the log for "Couldn't find match..." messages. If a view cannot be matched to its counterpart, try setting the same tag for both views.
  52 +
  53 +## Licence
  54 +
  55 +This code is licensed under the terms of the MIT license.
  56 +
  57 +Michael Tyson
  58 +A Tasty Pixel
25 TPMultiLayoutViewController.h
... ... @@ -0,0 +1,25 @@
  1 +//
  2 +// TPMultiLayoutViewController.h
  3 +//
  4 +// Created by Michael Tyson on 14/08/2011.
  5 +// Copyright 2011 A Tasty Pixel. All rights reserved.
  6 +//
  7 +
  8 +#import <UIKit/UIKit.h>
  9 +
  10 +@interface TPMultiLayoutViewController : UIViewController {
  11 + UIView *portraitView;
  12 + UIView *landscapeView;
  13 +
  14 + @private
  15 + NSDictionary *portraitAttributes;
  16 + NSDictionary *landscapeAttributes;
  17 + BOOL viewIsCurrentlyPortrait;
  18 +}
  19 +
  20 +// Call directly to use with custom animation (override willRotateToInterfaceOrientation to disable the switch there)
  21 +- (void)applyLayoutForInterfaceOrientation:(UIInterfaceOrientation)newOrientation;
  22 +
  23 +@property (nonatomic, retain) IBOutlet UIView *landscapeView;
  24 +@property (nonatomic, retain) IBOutlet UIView *portraitView;
  25 +@end
236 TPMultiLayoutViewController.m
... ... @@ -0,0 +1,236 @@
  1 +//
  2 +// TPMultiLayoutViewController.m
  3 +//
  4 +// Created by Michael Tyson on 14/08/2011.
  5 +// Copyright 2011 A Tasty Pixel. All rights reserved.
  6 +//
  7 +
  8 +#import "TPMultiLayoutViewController.h"
  9 +
  10 +#define VERBOSE_MATCH_FAIL 1 // Comment this out to be less verbose when associated views can't be found
  11 +
  12 +@interface TPMultiLayoutViewController ()
  13 +- (NSDictionary*)attributeTableForViewHierarchy:(UIView*)rootView associateWithViewHierarchy:(UIView*)associatedRootView;
  14 +- (void)addAttributesForSubviewHierarchy:(UIView*)view associatedWithSubviewHierarchy:(UIView*)associatedView toTable:(NSMutableDictionary*)table;
  15 +- (UIView*)findAssociatedViewForView:(UIView*)view amongViews:(NSArray*)views;
  16 +- (void)applyAttributeTable:(NSDictionary*)table toViewHierarchy:(UIView*)view;
  17 +- (NSDictionary*)attributesForView:(UIView*)view;
  18 +- (void)applyAttributes:(NSDictionary*)attributes toView:(UIView*)view;
  19 +- (BOOL)shouldDescendIntoSubviewsOfView:(UIView*)view;
  20 +@end
  21 +
  22 +@implementation TPMultiLayoutViewController
  23 +@synthesize portraitView, landscapeView;
  24 +
  25 +#pragma mark - View lifecycle
  26 +
  27 +- (void)viewDidLoad {
  28 + [super viewDidLoad];
  29 +
  30 + // Construct attribute tables
  31 + portraitAttributes = [[self attributeTableForViewHierarchy:portraitView associateWithViewHierarchy:self.view] retain];
  32 + landscapeAttributes = [[self attributeTableForViewHierarchy:landscapeView associateWithViewHierarchy:self.view] retain];
  33 + viewIsCurrentlyPortrait = (self.view == portraitView);
  34 +
  35 + // Don't need to retain the original template view hierarchies any more
  36 + self.portraitView = nil;
  37 + self.landscapeView = nil;
  38 +}
  39 +
  40 +- (void)viewDidUnload {
  41 + [super viewDidUnload];
  42 +
  43 + [portraitAttributes release];
  44 + portraitAttributes = nil;
  45 + [landscapeAttributes release];
  46 + landscapeAttributes = nil;
  47 +}
  48 +
  49 +- (void)dealloc {
  50 + [portraitAttributes release];
  51 + portraitAttributes = nil;
  52 + [landscapeAttributes release];
  53 + landscapeAttributes = nil;
  54 +
  55 + [super dealloc];
  56 +}
  57 +
  58 +-(void)viewWillAppear:(BOOL)animated {
  59 + // Display correct layout for orientation
  60 + if ( (UIInterfaceOrientationIsPortrait(self.interfaceOrientation) && !viewIsCurrentlyPortrait) ||
  61 + (UIInterfaceOrientationIsLandscape(self.interfaceOrientation) && viewIsCurrentlyPortrait) ) {
  62 + [self applyLayoutForInterfaceOrientation:self.interfaceOrientation];
  63 + }
  64 +}
  65 +
  66 +#pragma mark - Rotation
  67 +
  68 +- (void)applyLayoutForInterfaceOrientation:(UIInterfaceOrientation)newOrientation {
  69 + NSDictionary *table = UIInterfaceOrientationIsPortrait(newOrientation) ? portraitAttributes : landscapeAttributes;
  70 + [self applyAttributeTable:table toViewHierarchy:self.view];
  71 + viewIsCurrentlyPortrait = UIInterfaceOrientationIsPortrait(newOrientation);
  72 +}
  73 +
  74 +-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
  75 + if ( (UIInterfaceOrientationIsPortrait(toInterfaceOrientation) && !viewIsCurrentlyPortrait) ||
  76 + (UIInterfaceOrientationIsLandscape(toInterfaceOrientation) && viewIsCurrentlyPortrait) ) {
  77 + [self applyLayoutForInterfaceOrientation:toInterfaceOrientation];
  78 + }
  79 +}
  80 +
  81 +#pragma mark - Helpers
  82 +
  83 +- (NSDictionary*)attributeTableForViewHierarchy:(UIView*)rootView associateWithViewHierarchy:(UIView*)associatedRootView {
  84 + NSMutableDictionary *table = [NSMutableDictionary dictionary];
  85 + [self addAttributesForSubviewHierarchy:rootView associatedWithSubviewHierarchy:associatedRootView toTable:table];
  86 + return table;
  87 +}
  88 +
  89 +- (void)addAttributesForSubviewHierarchy:(UIView*)view associatedWithSubviewHierarchy:(UIView*)associatedView toTable:(NSMutableDictionary*)table {
  90 + [table setObject:[self attributesForView:view] forKey:[NSValue valueWithPointer:associatedView]];
  91 +
  92 + if ( ![self shouldDescendIntoSubviewsOfView:view] ) return;
  93 +
  94 + for ( UIView *subview in view.subviews ) {
  95 + UIView *associatedSubView = (view == associatedView ? subview : [self findAssociatedViewForView:subview amongViews:associatedView.subviews]);
  96 + if ( associatedSubView ) {
  97 + [self addAttributesForSubviewHierarchy:subview associatedWithSubviewHierarchy:associatedSubView toTable:table];
  98 + }
  99 + }
  100 +}
  101 +
  102 +- (UIView*)findAssociatedViewForView:(UIView*)view amongViews:(NSArray*)views {
  103 + // First try to match tag
  104 + if ( view.tag != 0 ) {
  105 + UIView *associatedView = [[views filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"tag = %d", view.tag]] lastObject];
  106 + if ( associatedView ) return associatedView;
  107 + }
  108 +
  109 + // Next, try to match class, targets and actions, if it's a control
  110 + if ( [view isKindOfClass:[UIControl class]] && [[(UIControl*)view allTargets] count] > 0 ) {
  111 + for ( UIView *otherView in views ) {
  112 + if ( [otherView isKindOfClass:[view class]]
  113 + && [[(UIControl*)otherView allTargets] isEqualToSet:[(UIControl*)view allTargets]]
  114 + && [(UIControl*)otherView allControlEvents] == [(UIControl*)view allControlEvents] ) {
  115 + // Try to match all actions and targets for each associated control event
  116 + BOOL allActionsMatch = YES;
  117 + UIControlEvents controlEvents = [(UIControl*)otherView allControlEvents];
  118 + for ( id target in [(UIControl*)otherView allTargets] ) {
  119 + // Iterate over each bit in the UIControlEvents bitfield
  120 + for ( NSInteger i=0; i<sizeof(UIControlEvents)*8; i++ ) {
  121 + UIControlEvents event = 1 << i;
  122 + if ( !(controlEvents & event) ) continue;
  123 + if ( ![[(UIControl*)otherView actionsForTarget:target forControlEvent:event] isEqualToArray:[(UIControl*)view actionsForTarget:target forControlEvent:event]] ) {
  124 + allActionsMatch = NO;
  125 + break;
  126 + }
  127 + }
  128 + if ( !allActionsMatch ) break;
  129 + }
  130 +
  131 + if ( allActionsMatch ) {
  132 + return otherView;
  133 + }
  134 + }
  135 + }
  136 + }
  137 +
  138 + // Next, try to match title or image, if it's a button
  139 + if ( [view isKindOfClass:[UIButton class]] ) {
  140 + for ( UIView *otherView in views ) {
  141 + if ( [otherView isKindOfClass:[view class]] && [[(UIButton*)otherView titleForState:UIControlStateNormal] isEqualToString:[(UIButton*)view titleForState:UIControlStateNormal]] ) {
  142 + return otherView;
  143 + }
  144 + }
  145 +
  146 + for ( UIView *otherView in views ) {
  147 + if ( [otherView isKindOfClass:[view class]] && [(UIButton*)otherView imageForState:UIControlStateNormal] == [(UIButton*)view imageForState:UIControlStateNormal] ) {
  148 + return otherView;
  149 + }
  150 + }
  151 + }
  152 +
  153 + // Try to match by title if it's a label
  154 + if ( [view isKindOfClass:[UILabel class]] ) {
  155 + for ( UIView *otherView in views ) {
  156 + if ( [otherView isKindOfClass:[view class]] && [[(UILabel*)otherView text] isEqualToString:[(UILabel*)view text]] ) {
  157 + return otherView;
  158 + }
  159 + }
  160 + }
  161 +
  162 + // Try to match by text/placeholder if it's a text field
  163 + if ( [view isKindOfClass:[UITextField class]] ) {
  164 + for ( UIView *otherView in views ) {
  165 + if ( [otherView isKindOfClass:[view class]] && ([(UITextField*)view text] || [(UITextField*)view placeholder]) &&
  166 + ((![(UITextField*)view text] && ![(UITextField*)otherView text]) || [[(UITextField*)otherView text] isEqualToString:[(UITextField*)view text]]) &&
  167 + ((![(UITextField*)view placeholder] && ![(UITextField*)otherView placeholder]) || [[(UITextField*)otherView placeholder] isEqualToString:[(UITextField*)view placeholder]]) ) {
  168 + return otherView;
  169 + }
  170 + }
  171 + }
  172 +
  173 + // Finally, try to match by class
  174 + NSArray *matches = [views filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"class = %@", [view class]]];
  175 + if ( [matches count] == 1 ) return [matches lastObject];
  176 +
  177 +#if VERBOSE_MATCH_FAIL
  178 + NSMutableString *path = [NSMutableString string];
  179 + for ( UIView *v = view.superview; v != nil; v = v.superview ) {
  180 + [path insertString:[NSString stringWithFormat:@"%@ => ", NSStringFromClass([v class])] atIndex:0];
  181 + }
  182 + NSLog(@"Couldn't find match for %@%@", path, NSStringFromClass([view class]));
  183 +
  184 +#endif
  185 +
  186 + return nil;
  187 +}
  188 +
  189 +- (void)applyAttributeTable:(NSDictionary*)table toViewHierarchy:(UIView*)view {
  190 + NSDictionary *attributes = [table objectForKey:[NSValue valueWithPointer:view]];
  191 + if ( attributes ) {
  192 + [self applyAttributes:attributes toView:view];
  193 + }
  194 +
  195 + if ( view.hidden ) return;
  196 +
  197 + if ( ![self shouldDescendIntoSubviewsOfView:view] ) return;
  198 +
  199 + for ( UIView *subview in view.subviews ) {
  200 + [self applyAttributeTable:table toViewHierarchy:subview];
  201 + }
  202 +}
  203 +
  204 +- (NSDictionary*)attributesForView:(UIView*)view {
  205 + NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
  206 +
  207 + [attributes setObject:[NSValue valueWithCGRect:view.frame] forKey:@"frame"];
  208 + [attributes setObject:[NSValue valueWithCGRect:view.bounds] forKey:@"bounds"];
  209 + [attributes setObject:[NSNumber numberWithBool:view.hidden] forKey:@"hidden"];
  210 + [attributes setObject:[NSNumber numberWithInteger:view.autoresizingMask] forKey:@"autoresizingMask"];
  211 +
  212 + return attributes;
  213 +}
  214 +
  215 +- (void)applyAttributes:(NSDictionary*)attributes toView:(UIView*)view {
  216 + view.frame = [[attributes objectForKey:@"frame"] CGRectValue];
  217 + view.bounds = [[attributes objectForKey:@"bounds"] CGRectValue];
  218 + view.hidden = [[attributes objectForKey:@"hidden"] boolValue];
  219 + view.autoresizingMask = [[attributes objectForKey:@"autoresizingMask"] integerValue];
  220 +}
  221 +
  222 +- (BOOL)shouldDescendIntoSubviewsOfView:(UIView*)view {
  223 + if ( [view isKindOfClass:[UISlider class]] ||
  224 + [view isKindOfClass:[UISwitch class]] ||
  225 + [view isKindOfClass:[UITextField class]] ||
  226 + [view isKindOfClass:[UIWebView class]] ||
  227 + [view isKindOfClass:[UITableView class]] ||
  228 + [view isKindOfClass:[UIPickerView class]] ||
  229 + [view isKindOfClass:[UIDatePicker class]] ||
  230 + [view isKindOfClass:[UITextView class]] ||
  231 + [view isKindOfClass:[UIProgressView class]] ||
  232 + [view isKindOfClass:[UISegmentedControl class]] ) return NO;
  233 + return YES;
  234 +}
  235 +
  236 +@end
15 TPMultiLayoutViewControllerTest.xcodeproj/project.pbxproj
@@ -7,6 +7,7 @@
7 7 objects = {
8 8
9 9 /* Begin PBXBuildFile section */
  10 + 4C37150513F82B5E004B8958 /* TPMultiLayoutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C37150413F82B5E004B8958 /* TPMultiLayoutViewController.m */; };
10 11 4C41456D13F810C9005332D6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C41456C13F810C9005332D6 /* UIKit.framework */; };
11 12 4C41456F13F810C9005332D6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C41456E13F810C9005332D6 /* Foundation.framework */; };
12 13 4C41457113F810C9005332D6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C41457013F810C9005332D6 /* CoreGraphics.framework */; };
@@ -19,18 +20,20 @@
19 20 /* End PBXBuildFile section */
20 21
21 22 /* Begin PBXFileReference section */
  23 + 4C37150313F82B5E004B8958 /* TPMultiLayoutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPMultiLayoutViewController.h; sourceTree = "<group>"; };
  24 + 4C37150413F82B5E004B8958 /* TPMultiLayoutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TPMultiLayoutViewController.m; sourceTree = "<group>"; };
22 25 4C41456813F810C9005332D6 /* TPMultiLayoutViewControllerTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TPMultiLayoutViewControllerTest.app; sourceTree = BUILT_PRODUCTS_DIR; };
23 26 4C41456C13F810C9005332D6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
24 27 4C41456E13F810C9005332D6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
25 28 4C41457013F810C9005332D6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
26   - 4C41457413F810CA005332D6 /* TPMultiLayoutViewControllerTest-Info.plist */ = {isa = PBXFileReference; path = "TPMultiLayoutViewControllerTest-Info.plist"; sourceTree = "<group>"; };
  29 + 4C41457413F810CA005332D6 /* TPMultiLayoutViewControllerTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TPMultiLayoutViewControllerTest-Info.plist"; sourceTree = "<group>"; };
27 30 4C41457613F810CA005332D6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
28 31 4C41457813F810CA005332D6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29   - 4C41457A13F810CA005332D6 /* TPMultiLayoutViewControllerTest-Prefix.pch */ = {isa = PBXFileReference; path = "TPMultiLayoutViewControllerTest-Prefix.pch"; sourceTree = "<group>"; };
30   - 4C41457B13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.h */ = {isa = PBXFileReference; path = TPMultiLayoutViewControllerTestAppDelegate.h; sourceTree = "<group>"; };
  32 + 4C41457A13F810CA005332D6 /* TPMultiLayoutViewControllerTest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TPMultiLayoutViewControllerTest-Prefix.pch"; sourceTree = "<group>"; };
  33 + 4C41457B13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TPMultiLayoutViewControllerTestAppDelegate.h; sourceTree = "<group>"; };
31 34 4C41457C13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TPMultiLayoutViewControllerTestAppDelegate.m; sourceTree = "<group>"; };
32 35 4C41457F13F810CA005332D6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = "<group>"; };
33   - 4C41458113F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.h */ = {isa = PBXFileReference; path = TPMultiLayoutViewControllerTestViewController.h; sourceTree = "<group>"; };
  36 + 4C41458113F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TPMultiLayoutViewControllerTestViewController.h; sourceTree = "<group>"; };
34 37 4C41458213F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TPMultiLayoutViewControllerTestViewController.m; sourceTree = "<group>"; };
35 38 4C41458513F810CA005332D6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/TPMultiLayoutViewControllerTestViewController.xib; sourceTree = "<group>"; };
36 39 /* End PBXFileReference section */
@@ -52,6 +55,8 @@
52 55 4C41455D13F810C9005332D6 = {
53 56 isa = PBXGroup;
54 57 children = (
  58 + 4C37150313F82B5E004B8958 /* TPMultiLayoutViewController.h */,
  59 + 4C37150413F82B5E004B8958 /* TPMultiLayoutViewController.m */,
55 60 4C41457213F810C9005332D6 /* TPMultiLayoutViewControllerTest */,
56 61 4C41456B13F810C9005332D6 /* Frameworks */,
57 62 4C41456913F810C9005332D6 /* Products */,
@@ -164,6 +169,7 @@
164 169 4C41457913F810CA005332D6 /* main.m in Sources */,
165 170 4C41457D13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.m in Sources */,
166 171 4C41458313F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.m in Sources */,
  172 + 4C37150513F82B5E004B8958 /* TPMultiLayoutViewController.m in Sources */,
167 173 );
168 174 runOnlyForDeploymentPostprocessing = 0;
169 175 };
@@ -281,6 +287,7 @@
281 287 4C41458B13F810CA005332D6 /* Release */,
282 288 );
283 289 defaultConfigurationIsVisible = 0;
  290 + defaultConfigurationName = Release;
284 291 };
285 292 /* End XCConfigurationList section */
286 293 };
7 TPMultiLayoutViewControllerTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata
... ... @@ -0,0 +1,7 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<Workspace
  3 + version = "1.0">
  4 + <FileRef
  5 + location = "self:TPMultiLayoutViewControllerTest.xcodeproj">
  6 + </FileRef>
  7 +</Workspace>
2  TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTestAppDelegate.h
@@ -3,7 +3,7 @@
3 3 // TPMultiLayoutViewControllerTest
4 4 //
5 5 // Created by Michael Tyson on 14/08/2011.
6   -// Copyright 2011 __MyCompanyName__. All rights reserved.
  6 +// Copyright 2011 A Tasty Pixel. All rights reserved.
7 7 //
8 8
9 9 #import <UIKit/UIKit.h>
2  TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTestAppDelegate.m
@@ -3,7 +3,7 @@
3 3 // TPMultiLayoutViewControllerTest
4 4 //
5 5 // Created by Michael Tyson on 14/08/2011.
6   -// Copyright 2011 __MyCompanyName__. All rights reserved.
  6 +// Copyright 2011 A Tasty Pixel. All rights reserved.
7 7 //
8 8
9 9 #import "TPMultiLayoutViewControllerTestAppDelegate.h"
10 TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTestViewController.h
@@ -3,11 +3,17 @@
3 3 // TPMultiLayoutViewControllerTest
4 4 //
5 5 // Created by Michael Tyson on 14/08/2011.
6   -// Copyright 2011 __MyCompanyName__. All rights reserved.
  6 +// Copyright 2011 A Tasty Pixel. All rights reserved.
7 7 //
8 8
9 9 #import <UIKit/UIKit.h>
  10 +#import "TPMultiLayoutViewController.h"
10 11
11   -@interface TPMultiLayoutViewControllerTestViewController : UIViewController
  12 +@interface TPMultiLayoutViewControllerTestViewController : TPMultiLayoutViewController {
  13 + UILabel *sliderLabel;
  14 +}
12 15
  16 +- (IBAction)updateSliderLabel:(id)sender;
  17 +
  18 +@property (nonatomic, retain) IBOutlet UILabel *sliderLabel;
13 19 @end
15 TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTestViewController.m
@@ -3,12 +3,13 @@
3 3 // TPMultiLayoutViewControllerTest
4 4 //
5 5 // Created by Michael Tyson on 14/08/2011.
6   -// Copyright 2011 __MyCompanyName__. All rights reserved.
  6 +// Copyright 2011 A Tasty Pixel. All rights reserved.
7 7 //
8 8
9 9 #import "TPMultiLayoutViewControllerTestViewController.h"
10 10
11 11 @implementation TPMultiLayoutViewControllerTestViewController
  12 +@synthesize sliderLabel;
12 13
13 14 - (void)didReceiveMemoryWarning
14 15 {
@@ -30,6 +31,7 @@ - (void)viewDidLoad
30 31
31 32 - (void)viewDidUnload
32 33 {
  34 + [self setSliderLabel:nil];
33 35 [super viewDidUnload];
34 36 // Release any retained subviews of the main view.
35 37 // e.g. self.myOutlet = nil;
@@ -38,7 +40,16 @@ - (void)viewDidUnload
38 40 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
39 41 {
40 42 // Return YES for supported orientations
41   - return (interfaceOrientation == UIInterfaceOrientationPortrait);
  43 + return YES;
  44 +}
  45 +
  46 +- (void)dealloc {
  47 + [sliderLabel release];
  48 + [super dealloc];
  49 +}
  50 +
  51 +- (IBAction)updateSliderLabel:(id)sender {
  52 + sliderLabel.text = [NSString stringWithFormat:@"%g", ((UISlider*)sender).value];
42 53 }
43 54
44 55 @end
681 TPMultiLayoutViewControllerTest/en.lproj/TPMultiLayoutViewControllerTestViewController.xib
... ... @@ -1,18 +1,23 @@
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
3 3 <data>
4   - <int key="IBDocument.SystemTarget">800</int>
5   - <string key="IBDocument.SystemVersion">10C540</string>
6   - <string key="IBDocument.InterfaceBuilderVersion">759</string>
7   - <string key="IBDocument.AppKitVersion">1038.25</string>
8   - <string key="IBDocument.HIToolboxVersion">458.00</string>
  4 + <int key="IBDocument.SystemTarget">1056</int>
  5 + <string key="IBDocument.SystemVersion">11A511</string>
  6 + <string key="IBDocument.InterfaceBuilderVersion">1617</string>
  7 + <string key="IBDocument.AppKitVersion">1138</string>
  8 + <string key="IBDocument.HIToolboxVersion">566.00</string>
9 9 <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
10 10 <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
11   - <string key="NS.object.0">77</string>
  11 + <string key="NS.object.0">534</string>
12 12 </object>
13   - <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
  13 + <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
14 14 <bool key="EncodedWithXMLCoder">YES</bool>
15   - <integer value="6"/>
  15 + <string>IBUITextField</string>
  16 + <string>IBUISlider</string>
  17 + <string>IBUIButton</string>
  18 + <string>IBUIView</string>
  19 + <string>IBUILabel</string>
  20 + <string>IBProxyObject</string>
16 21 </object>
17 22 <object class="NSArray" key="IBDocument.PluginDependencies">
18 23 <bool key="EncodedWithXMLCoder">YES</bool>
@@ -23,9 +28,7 @@
23 28 <object class="NSArray" key="dict.sortedKeys" id="0">
24 29 <bool key="EncodedWithXMLCoder">YES</bool>
25 30 </object>
26   - <object class="NSMutableArray" key="dict.values">
27   - <bool key="EncodedWithXMLCoder">YES</bool>
28   - </object>
  31 + <reference key="dict.values" ref="0"/>
29 32 </object>
30 33 <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
31 34 <bool key="EncodedWithXMLCoder">YES</bool>
@@ -40,17 +43,398 @@
40 43 <object class="IBUIView" id="774585933">
41 44 <reference key="NSNextResponder"/>
42 45 <int key="NSvFlags">274</int>
43   - <string key="NSFrameSize">{320, 460}</string>
  46 + <object class="NSMutableArray" key="NSSubviews">
  47 + <bool key="EncodedWithXMLCoder">YES</bool>
  48 + <object class="IBUILabel" id="551229343">
  49 + <reference key="NSNextResponder" ref="774585933"/>
  50 + <int key="NSvFlags">292</int>
  51 + <string key="NSFrame">{{29, 20}, {57, 21}}</string>
  52 + <reference key="NSSuperview" ref="774585933"/>
  53 + <reference key="NSWindow"/>
  54 + <reference key="NSNextKeyView" ref="641845640"/>
  55 + <string key="NSReuseIdentifierKey">_NS:311</string>
  56 + <bool key="IBUIOpaque">NO</bool>
  57 + <bool key="IBUIClipsSubviews">YES</bool>
  58 + <int key="IBUIContentMode">7</int>
  59 + <bool key="IBUIUserInteractionEnabled">NO</bool>
  60 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  61 + <string key="IBUIText">Label 1</string>
  62 + <object class="NSFont" key="IBUIFont" id="390806903">
  63 + <string key="NSName">Helvetica</string>
  64 + <double key="NSSize">17</double>
  65 + <int key="NSfFlags">16</int>
  66 + </object>
  67 + <object class="NSColor" key="IBUITextColor" id="31292076">
  68 + <int key="NSColorSpace">1</int>
  69 + <bytes key="NSRGB">MCAwIDAAA</bytes>
  70 + </object>
  71 + <nil key="IBUIHighlightedColor"/>
  72 + <int key="IBUIBaselineAdjustment">1</int>
  73 + <float key="IBUIMinimumFontSize">10</float>
  74 + </object>
  75 + <object class="IBUITextField" id="641845640">
  76 + <reference key="NSNextResponder" ref="774585933"/>
  77 + <int key="NSvFlags">292</int>
  78 + <string key="NSFrame">{{102, 15}, {186, 31}}</string>
  79 + <reference key="NSSuperview" ref="774585933"/>
  80 + <reference key="NSWindow"/>
  81 + <reference key="NSNextKeyView" ref="367898585"/>
  82 + <string key="NSReuseIdentifierKey">_NS:294</string>
  83 + <bool key="IBUIOpaque">NO</bool>
  84 + <bool key="IBUIClipsSubviews">YES</bool>
  85 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  86 + <int key="IBUIContentVerticalAlignment">0</int>
  87 + <string key="IBUIText">Text 1</string>
  88 + <int key="IBUIBorderStyle">3</int>
  89 + <object class="NSColor" key="IBUITextColor">
  90 + <int key="NSColorSpace">3</int>
  91 + <bytes key="NSWhite">MAA</bytes>
  92 + <object class="NSColorSpace" key="NSCustomColorSpace" id="529094012">
  93 + <int key="NSID">2</int>
  94 + </object>
  95 + </object>
  96 + <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
  97 + <float key="IBUIMinimumFontSize">17</float>
  98 + <object class="IBUITextInputTraits" key="IBUITextInputTraits">
  99 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  100 + </object>
  101 + </object>
  102 + <object class="IBUILabel" id="367898585">
  103 + <reference key="NSNextResponder" ref="774585933"/>
  104 + <int key="NSvFlags">292</int>
  105 + <string key="NSFrame">{{29, 59}, {57, 21}}</string>
  106 + <reference key="NSSuperview" ref="774585933"/>
  107 + <reference key="NSWindow"/>
  108 + <reference key="NSNextKeyView" ref="88376000"/>
  109 + <string key="NSReuseIdentifierKey">_NS:311</string>
  110 + <bool key="IBUIOpaque">NO</bool>
  111 + <bool key="IBUIClipsSubviews">YES</bool>
  112 + <int key="IBUIContentMode">7</int>
  113 + <bool key="IBUIUserInteractionEnabled">NO</bool>
  114 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  115 + <string key="IBUIText">Label 2</string>
  116 + <reference key="IBUIFont" ref="390806903"/>
  117 + <reference key="IBUITextColor" ref="31292076"/>
  118 + <nil key="IBUIHighlightedColor"/>
  119 + <int key="IBUIBaselineAdjustment">1</int>
  120 + <float key="IBUIMinimumFontSize">10</float>
  121 + </object>
  122 + <object class="IBUITextField" id="88376000">
  123 + <reference key="NSNextResponder" ref="774585933"/>
  124 + <int key="NSvFlags">292</int>
  125 + <string key="NSFrame">{{102, 54}, {186, 31}}</string>
  126 + <reference key="NSSuperview" ref="774585933"/>
  127 + <reference key="NSWindow"/>
  128 + <reference key="NSNextKeyView" ref="131651654"/>
  129 + <string key="NSReuseIdentifierKey">_NS:294</string>
  130 + <bool key="IBUIOpaque">NO</bool>
  131 + <bool key="IBUIClipsSubviews">YES</bool>
  132 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  133 + <int key="IBUIContentVerticalAlignment">0</int>
  134 + <string key="IBUIText">Text 2</string>
  135 + <int key="IBUIBorderStyle">3</int>
  136 + <object class="NSColor" key="IBUITextColor">
  137 + <int key="NSColorSpace">3</int>
  138 + <bytes key="NSWhite">MAA</bytes>
  139 + <reference key="NSCustomColorSpace" ref="529094012"/>
  140 + </object>
  141 + <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
  142 + <float key="IBUIMinimumFontSize">17</float>
  143 + <object class="IBUITextInputTraits" key="IBUITextInputTraits">
  144 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  145 + </object>
  146 + </object>
  147 + <object class="IBUIButton" id="131651654">
  148 + <reference key="NSNextResponder" ref="774585933"/>
  149 + <int key="NSvFlags">292</int>
  150 + <string key="NSFrame">{{29, 167}, {107, 115}}</string>
  151 + <reference key="NSSuperview" ref="774585933"/>
  152 + <reference key="NSWindow"/>
  153 + <reference key="NSNextKeyView" ref="830519548"/>
  154 + <string key="NSReuseIdentifierKey">_NS:222</string>
  155 + <bool key="IBUIOpaque">NO</bool>
  156 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  157 + <int key="IBUIContentHorizontalAlignment">0</int>
  158 + <int key="IBUIContentVerticalAlignment">0</int>
  159 + <object class="NSFont" key="IBUIFont" id="308752132">
  160 + <string key="NSName">Helvetica-Bold</string>
  161 + <double key="NSSize">15</double>
  162 + <int key="NSfFlags">16</int>
  163 + </object>
  164 + <int key="IBUIButtonType">1</int>
  165 + <string key="IBUINormalTitle">A</string>
  166 + <object class="NSColor" key="IBUIHighlightedTitleColor" id="675214983">
  167 + <int key="NSColorSpace">3</int>
  168 + <bytes key="NSWhite">MQA</bytes>
  169 + </object>
  170 + <object class="NSColor" key="IBUINormalTitleColor">
  171 + <int key="NSColorSpace">1</int>
  172 + <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
  173 + </object>
  174 + <object class="NSColor" key="IBUINormalTitleShadowColor" id="197873870">
  175 + <int key="NSColorSpace">3</int>
  176 + <bytes key="NSWhite">MC41AA</bytes>
  177 + </object>
  178 + </object>
  179 + <object class="IBUIButton" id="830519548">
  180 + <reference key="NSNextResponder" ref="774585933"/>
  181 + <int key="NSvFlags">292</int>
  182 + <string key="NSFrame">{{181, 167}, {107, 115}}</string>
  183 + <reference key="NSSuperview" ref="774585933"/>
  184 + <reference key="NSWindow"/>
  185 + <reference key="NSNextKeyView" ref="951307503"/>
  186 + <string key="NSReuseIdentifierKey">_NS:222</string>
  187 + <bool key="IBUIOpaque">NO</bool>
  188 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  189 + <int key="IBUIContentHorizontalAlignment">0</int>
  190 + <int key="IBUIContentVerticalAlignment">0</int>
  191 + <reference key="IBUIFont" ref="308752132"/>
  192 + <int key="IBUIButtonType">1</int>
  193 + <string key="IBUINormalTitle">B</string>
  194 + <reference key="IBUIHighlightedTitleColor" ref="675214983"/>
  195 + <object class="NSColor" key="IBUINormalTitleColor">
  196 + <int key="NSColorSpace">1</int>
  197 + <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
  198 + </object>
  199 + <reference key="IBUINormalTitleShadowColor" ref="197873870"/>
  200 + </object>
  201 + <object class="IBUISlider" id="3306263">
  202 + <reference key="NSNextResponder" ref="774585933"/>
  203 + <int key="NSvFlags">292</int>
  204 + <string key="NSFrame">{{42, 395}, {236, 23}}</string>
  205 + <reference key="NSSuperview" ref="774585933"/>
  206 + <reference key="NSWindow"/>
  207 + <reference key="NSNextKeyView"/>
  208 + <string key="NSReuseIdentifierKey">_NS:605</string>
  209 + <bool key="IBUIOpaque">NO</bool>
  210 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  211 + <int key="IBUIContentHorizontalAlignment">0</int>
  212 + <int key="IBUIContentVerticalAlignment">0</int>
  213 + <float key="IBUIValue">0.5</float>
  214 + </object>
  215 + <object class="IBUILabel" id="951307503">
  216 + <reference key="NSNextResponder" ref="774585933"/>
  217 + <int key="NSvFlags">292</int>
  218 + <string key="NSFrame">{{44, 350}, {232, 21}}</string>
  219 + <reference key="NSSuperview" ref="774585933"/>
  220 + <reference key="NSWindow"/>
  221 + <reference key="NSNextKeyView" ref="3306263"/>
  222 + <string key="NSReuseIdentifierKey">_NS:311</string>
  223 + <bool key="IBUIOpaque">NO</bool>
  224 + <bool key="IBUIClipsSubviews">YES</bool>
  225 + <int key="IBUIContentMode">7</int>
  226 + <bool key="IBUIUserInteractionEnabled">NO</bool>
  227 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  228 + <string key="IBUIText">Label</string>
  229 + <reference key="IBUITextColor" ref="31292076"/>
  230 + <nil key="IBUIHighlightedColor"/>
  231 + <int key="IBUIBaselineAdjustment">1</int>
  232 + <float key="IBUIMinimumFontSize">10</float>
  233 + <int key="IBUITextAlignment">1</int>
  234 + </object>
  235 + </object>
  236 + <string key="NSFrame">{{0, 20}, {320, 460}}</string>
44 237 <reference key="NSSuperview"/>
  238 + <reference key="NSWindow"/>
  239 + <reference key="NSNextKeyView" ref="551229343"/>
45 240 <object class="NSColor" key="IBUIBackgroundColor">
46 241 <int key="NSColorSpace">3</int>
47 242 <bytes key="NSWhite">MC43NQA</bytes>
48   - <object class="NSColorSpace" key="NSCustomColorSpace">
49   - <int key="NSID">2</int>
  243 + <reference key="NSCustomColorSpace" ref="529094012"/>
  244 + </object>
  245 + <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
  246 + <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
  247 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  248 + </object>
  249 + <object class="IBUIView" id="37400504">
  250 + <reference key="NSNextResponder"/>
  251 + <int key="NSvFlags">274</int>
  252 + <object class="NSMutableArray" key="NSSubviews">
  253 + <bool key="EncodedWithXMLCoder">YES</bool>
  254 + <object class="IBUILabel" id="448081225">
  255 + <reference key="NSNextResponder" ref="37400504"/>
  256 + <int key="NSvFlags">292</int>
  257 + <string key="NSFrame">{{23, 27}, {57, 21}}</string>
  258 + <reference key="NSSuperview" ref="37400504"/>
  259 + <reference key="NSWindow"/>
  260 + <reference key="NSNextKeyView" ref="795952665"/>
  261 + <string key="NSReuseIdentifierKey">_NS:311</string>
  262 + <bool key="IBUIOpaque">NO</bool>
  263 + <bool key="IBUIClipsSubviews">YES</bool>
  264 + <int key="IBUIContentMode">7</int>
  265 + <bool key="IBUIUserInteractionEnabled">NO</bool>
  266 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  267 + <string key="IBUIText">Label 1</string>
  268 + <reference key="IBUIFont" ref="390806903"/>
  269 + <reference key="IBUITextColor" ref="31292076"/>
  270 + <nil key="IBUIHighlightedColor"/>
  271 + <int key="IBUIBaselineAdjustment">1</int>
  272 + <float key="IBUIMinimumFontSize">10</float>
  273 + </object>
  274 + <object class="IBUITextField" id="795952665">
  275 + <reference key="NSNextResponder" ref="37400504"/>
  276 + <int key="NSvFlags">292</int>
  277 + <string key="NSFrame">{{89, 20}, {359, 31}}</string>
  278 + <reference key="NSSuperview" ref="37400504"/>
  279 + <reference key="NSWindow"/>
  280 + <reference key="NSNextKeyView" ref="686317664"/>
  281 + <string key="NSReuseIdentifierKey">_NS:294</string>
  282 + <bool key="IBUIOpaque">NO</bool>
  283 + <bool key="IBUIClipsSubviews">YES</bool>
  284 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  285 + <int key="IBUIContentVerticalAlignment">0</int>
  286 + <string key="IBUIText">Text 1</string>
  287 + <int key="IBUIBorderStyle">3</int>
  288 + <object class="NSColor" key="IBUITextColor">
  289 + <int key="NSColorSpace">3</int>
  290 + <bytes key="NSWhite">MAA</bytes>
  291 + <reference key="NSCustomColorSpace" ref="529094012"/>
  292 + </object>
  293 + <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
  294 + <float key="IBUIMinimumFontSize">17</float>
  295 + <object class="IBUITextInputTraits" key="IBUITextInputTraits">
  296 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  297 + </object>
  298 + </object>
  299 + <object class="IBUILabel" id="686317664">
  300 + <reference key="NSNextResponder" ref="37400504"/>
  301 + <int key="NSvFlags">292</int>
  302 + <string key="NSFrame">{{23, 66}, {57, 21}}</string>
  303 + <reference key="NSSuperview" ref="37400504"/>
  304 + <reference key="NSWindow"/>
  305 + <reference key="NSNextKeyView" ref="609811711"/>
  306 + <string key="NSReuseIdentifierKey">_NS:311</string>
  307 + <bool key="IBUIOpaque">NO</bool>
  308 + <bool key="IBUIClipsSubviews">YES</bool>
  309 + <int key="IBUIContentMode">7</int>
  310 + <bool key="IBUIUserInteractionEnabled">NO</bool>
  311 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  312 + <string key="IBUIText">Label 2</string>
  313 + <reference key="IBUIFont" ref="390806903"/>
  314 + <reference key="IBUITextColor" ref="31292076"/>
  315 + <nil key="IBUIHighlightedColor"/>
  316 + <int key="IBUIBaselineAdjustment">1</int>
  317 + <float key="IBUIMinimumFontSize">10</float>
  318 + </object>
  319 + <object class="IBUITextField" id="609811711">
  320 + <reference key="NSNextResponder" ref="37400504"/>
  321 + <int key="NSvFlags">292</int>
  322 + <string key="NSFrame">{{89, 59}, {359, 31}}</string>
  323 + <reference key="NSSuperview" ref="37400504"/>
  324 + <reference key="NSWindow"/>
  325 + <reference key="NSNextKeyView" ref="461735262"/>
  326 + <string key="NSReuseIdentifierKey">_NS:294</string>
  327 + <bool key="IBUIOpaque">NO</bool>
  328 + <bool key="IBUIClipsSubviews">YES</bool>
  329 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  330 + <int key="IBUIContentVerticalAlignment">0</int>
  331 + <string key="IBUIText">Text 2</string>
  332 + <int key="IBUIBorderStyle">3</int>
  333 + <object class="NSColor" key="IBUITextColor">
  334 + <int key="NSColorSpace">3</int>
  335 + <bytes key="NSWhite">MAA</bytes>
  336 + <reference key="NSCustomColorSpace" ref="529094012"/>
  337 + </object>
  338 + <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
  339 + <float key="IBUIMinimumFontSize">17</float>
  340 + <object class="IBUITextInputTraits" key="IBUITextInputTraits">
  341 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  342 + </object>
  343 + </object>
  344 + <object class="IBUIButton" id="461735262">
  345 + <reference key="NSNextResponder" ref="37400504"/>
  346 + <int key="NSvFlags">292</int>
  347 + <string key="NSFrame">{{20, 121}, {180, 70}}</string>
  348 + <reference key="NSSuperview" ref="37400504"/>
  349 + <reference key="NSWindow"/>
  350 + <reference key="NSNextKeyView" ref="874148184"/>
  351 + <string key="NSReuseIdentifierKey">_NS:222</string>
  352 + <bool key="IBUIOpaque">NO</bool>
  353 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  354 + <int key="IBUIContentHorizontalAlignment">0</int>
  355 + <int key="IBUIContentVerticalAlignment">0</int>
  356 + <reference key="IBUIFont" ref="308752132"/>
  357 + <int key="IBUIButtonType">1</int>
  358 + <string key="IBUINormalTitle">A</string>
  359 + <reference key="IBUIHighlightedTitleColor" ref="675214983"/>
  360 + <object class="NSColor" key="IBUINormalTitleColor">
  361 + <int key="NSColorSpace">1</int>
  362 + <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
  363 + </object>
  364 + <reference key="IBUINormalTitleShadowColor" ref="197873870"/>
50 365 </object>
  366 + <object class="IBUIButton" id="819155992">
  367 + <reference key="NSNextResponder" ref="37400504"/>
  368 + <int key="NSvFlags">292</int>
  369 + <string key="NSFrame">{{20, 209}, {180, 71}}</string>
  370 + <reference key="NSSuperview" ref="37400504"/>
  371 + <reference key="NSWindow"/>
  372 + <reference key="NSNextKeyView" ref="636976621"/>
  373 + <string key="NSReuseIdentifierKey">_NS:222</string>
  374 + <bool key="IBUIOpaque">NO</bool>
  375 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  376 + <int key="IBUIContentHorizontalAlignment">0</int>
  377 + <int key="IBUIContentVerticalAlignment">0</int>
  378 + <reference key="IBUIFont" ref="308752132"/>
  379 + <int key="IBUIButtonType">1</int>
  380 + <string key="IBUINormalTitle">B</string>
  381 + <reference key="IBUIHighlightedTitleColor" ref="675214983"/>
  382 + <object class="NSColor" key="IBUINormalTitleColor">
  383 + <int key="NSColorSpace">1</int>
  384 + <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
  385 + </object>
  386 + <reference key="IBUINormalTitleShadowColor" ref="197873870"/>
  387 + </object>
  388 + <object class="IBUISlider" id="636976621">
  389 + <reference key="NSNextResponder" ref="37400504"/>
  390 + <int key="NSvFlags">292</int>
  391 + <string key="NSFrame">{{226, 201}, {236, 23}}</string>
  392 + <reference key="NSSuperview" ref="37400504"/>
  393 + <reference key="NSWindow"/>
  394 + <reference key="NSNextKeyView"/>
  395 + <string key="NSReuseIdentifierKey">_NS:605</string>
  396 + <bool key="IBUIOpaque">NO</bool>
  397 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  398 + <int key="IBUIContentHorizontalAlignment">0</int>
  399 + <int key="IBUIContentVerticalAlignment">0</int>
  400 + <float key="IBUIValue">0.5</float>
  401 + </object>
  402 + <object class="IBUILabel" id="874148184">
  403 + <reference key="NSNextResponder" ref="37400504"/>
  404 + <int key="NSvFlags">292</int>
  405 + <string key="NSFrame">{{228, 150}, {232, 21}}</string>
  406 + <reference key="NSSuperview" ref="37400504"/>
  407 + <reference key="NSWindow"/>
  408 + <reference key="NSNextKeyView" ref="819155992"/>
  409 + <string key="NSReuseIdentifierKey">_NS:311</string>
  410 + <bool key="IBUIOpaque">NO</bool>
  411 + <bool key="IBUIClipsSubviews">YES</bool>
  412 + <int key="IBUIContentMode">7</int>
  413 + <bool key="IBUIUserInteractionEnabled">NO</bool>
  414 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  415 + <string key="IBUIText">Label</string>
  416 + <reference key="IBUITextColor" ref="31292076"/>
  417 + <nil key="IBUIHighlightedColor"/>
  418 + <int key="IBUIBaselineAdjustment">1</int>
  419 + <float key="IBUIMinimumFontSize">10</float>
  420 + <int key="IBUITextAlignment">1</int>
  421 + </object>
  422 + </object>
  423 + <string key="NSFrame">{{0, 20}, {480, 300}}</string>
  424 + <reference key="NSSuperview"/>
  425 + <reference key="NSWindow"/>
  426 + <reference key="NSNextKeyView" ref="448081225"/>
  427 + <object class="NSColor" key="IBUIBackgroundColor">
  428 + <int key="NSColorSpace">3</int>
  429 + <bytes key="NSWhite">MC43NQA</bytes>
  430 + <reference key="NSCustomColorSpace" ref="529094012"/>
51 431 </object>
52 432 <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
53 433 <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
  434 + <object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
  435 + <int key="IBUIInterfaceOrientation">3</int>
  436 + <int key="interfaceOrientation">3</int>
  437 + </object>
54 438 <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
55 439 </object>
56 440 </object>
@@ -65,6 +449,48 @@
65 449 </object>
66 450 <int key="connectionID">7</int>
67 451 </object>
  452 + <object class="IBConnectionRecord">
  453 + <object class="IBCocoaTouchOutletConnection" key="connection">
  454 + <string key="label">portraitView</string>
  455 + <reference key="source" ref="372490531"/>
  456 + <reference key="destination" ref="774585933"/>
  457 + </object>
  458 + <int key="connectionID">17</int>
  459 + </object>
  460 + <object class="IBConnectionRecord">
  461 + <object class="IBCocoaTouchOutletConnection" key="connection">
  462 + <string key="label">landscapeView</string>
  463 + <reference key="source" ref="372490531"/>
  464 + <reference key="destination" ref="37400504"/>
  465 + </object>
  466 + <int key="connectionID">18</int>
  467 + </object>
  468 + <object class="IBConnectionRecord">
  469 + <object class="IBCocoaTouchOutletConnection" key="connection">
  470 + <string key="label">sliderLabel</string>
  471 + <reference key="source" ref="372490531"/>
  472 + <reference key="destination" ref="951307503"/>
  473 + </object>
  474 + <int key="connectionID">19</int>
  475 + </object>
  476 + <object class="IBConnectionRecord">
  477 + <object class="IBCocoaTouchEventConnection" key="connection">
  478 + <string key="label">updateSliderLabel:</string>
  479 + <reference key="source" ref="3306263"/>
  480 + <reference key="destination" ref="372490531"/>
  481 + <int key="IBEventType">13</int>
  482 + </object>
  483 + <int key="connectionID">20</int>
  484 + </object>
  485 + <object class="IBConnectionRecord">
  486 + <object class="IBCocoaTouchEventConnection" key="connection">
  487 + <string key="label">updateSliderLabel:</string>
  488 + <reference key="source" ref="636976621"/>
  489 + <reference key="destination" ref="372490531"/>
  490 + <int key="IBEventType">13</int>
  491 + </object>
  492 + <int key="connectionID">29</int>
  493 + </object>
68 494 </object>
69 495 <object class="IBMutableOrderedSet" key="objectRecords">
70 496 <object class="NSArray" key="orderedObjects">
@@ -89,8 +515,115 @@
89 515 <object class="IBObjectRecord">
90 516 <int key="objectID">6</int>
91 517 <reference key="object" ref="774585933"/>
  518 + <object class="NSMutableArray" key="children">
  519 + <bool key="EncodedWithXMLCoder">YES</bool>
  520 + <reference ref="641845640"/>
  521 + <reference ref="88376000"/>
  522 + <reference ref="131651654"/>
  523 + <reference ref="830519548"/>
  524 + <reference ref="3306263"/>
  525 + <reference ref="951307503"/>
  526 + <reference ref="551229343"/>
  527 + <reference ref="367898585"/>
  528 + </object>
  529 + <reference key="parent" ref="0"/>