Skip to content
Browse files

Initial commit

  • Loading branch information...
1 parent d70cad3 commit 5490ded69d2ad2caa1b5f3e748ef0e462378abd4 @michaeltyson committed Aug 14, 2011
View
2 .gitignore
@@ -0,0 +1,2 @@
+.DS_Store
+xcuserdata
View
58 README.markdown
@@ -0,0 +1,58 @@
+TPMultiLayoutViewController
+===========================
+
+A drop-in UIViewController subclass that automatically manages switching between different view layouts
+for portrait and landscape orientations, without the need to maintain view state across two different
+view hierarchies.
+
+## The Problem
+
+ - You want to support portrait and landscape modes in your app.
+ - Having just one view layout for both portrait and landscape doesn't give good results.
+
+## The Conventional Solution: Double Handling
+
+ - Create two distinct view hierarchies: one for portrait and one for landscape.
+ - On orientation change, set `this.view` to either your portrait view, or your landscape view.
+ - On load, perform your initialisation on both views: *Big Overhead*.
+ - Whenever your view/app state changes, sync the state across both views: *Big Overhead*.
+
+## An Easier Solution: Layout Templating
+
+ - Create two distinct view hierarchies: one for portrait and one for landscape.
+ - Extract just the layout information from the two view versions: use the original two view hierarchies as a *layout template*.
+ - Maintain one single view hierarchy: no double handling, no state syncing.
+ - On orientation change, simply apply the layout information we extracted to our single view hierarchy, to achieve the new layout.
+
+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
+rearrange the view, using the layout we extracted from our original two views.
+
+## Usage
+
+ 1. Set the superclass for your view controller to TPMultiLayoutViewController.
+ 2. In Interface Builder, create two different views: one for portrait orientation, and one for landscape orientation.
+ 3. Attach your portrait orientation root view to the "portraitView" outlet, and the landscape orientation root view
+ to the "landscapeView" outlet.
+ 4. Attach one of the views (whichever you prefer) to the "view" outlet, and connect
+ any actions and outlets from that view.
+
+## Notes
+
+ - Currently, only `frame`, `bounds`, `hidden` and `autoresizingMask` attributes are assigned, but this can be easily extended. See `attributesForView:` and `applyAttributes:toView:` for details.
+ - Both layouts should have the same hierarchical structure.
+ - Views are matched to their counterparts in the other layout by searching for similarities, in the following order:
+ 1. Tag
+ 2. Class, target and action (for UIControl)
+ 3. Title or image (for UIButton)
+ 4. Title (for UILabel)
+ 5. Text or placeholder (for UITextField)
+ 6. Class
+
+ 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.
+
+## Licence
+
+This code is licensed under the terms of the MIT license.
+
+Michael Tyson
+A Tasty Pixel
View
25 TPMultiLayoutViewController.h
@@ -0,0 +1,25 @@
+//
+// TPMultiLayoutViewController.h
+//
+// Created by Michael Tyson on 14/08/2011.
+// Copyright 2011 A Tasty Pixel. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface TPMultiLayoutViewController : UIViewController {
+ UIView *portraitView;
+ UIView *landscapeView;
+
+ @private
+ NSDictionary *portraitAttributes;
+ NSDictionary *landscapeAttributes;
+ BOOL viewIsCurrentlyPortrait;
+}
+
+// Call directly to use with custom animation (override willRotateToInterfaceOrientation to disable the switch there)
+- (void)applyLayoutForInterfaceOrientation:(UIInterfaceOrientation)newOrientation;
+
+@property (nonatomic, retain) IBOutlet UIView *landscapeView;
+@property (nonatomic, retain) IBOutlet UIView *portraitView;
+@end
View
236 TPMultiLayoutViewController.m
@@ -0,0 +1,236 @@
+//
+// TPMultiLayoutViewController.m
+//
+// Created by Michael Tyson on 14/08/2011.
+// Copyright 2011 A Tasty Pixel. All rights reserved.
+//
+
+#import "TPMultiLayoutViewController.h"
+
+#define VERBOSE_MATCH_FAIL 1 // Comment this out to be less verbose when associated views can't be found
+
+@interface TPMultiLayoutViewController ()
+- (NSDictionary*)attributeTableForViewHierarchy:(UIView*)rootView associateWithViewHierarchy:(UIView*)associatedRootView;
+- (void)addAttributesForSubviewHierarchy:(UIView*)view associatedWithSubviewHierarchy:(UIView*)associatedView toTable:(NSMutableDictionary*)table;
+- (UIView*)findAssociatedViewForView:(UIView*)view amongViews:(NSArray*)views;
+- (void)applyAttributeTable:(NSDictionary*)table toViewHierarchy:(UIView*)view;
+- (NSDictionary*)attributesForView:(UIView*)view;
+- (void)applyAttributes:(NSDictionary*)attributes toView:(UIView*)view;
+- (BOOL)shouldDescendIntoSubviewsOfView:(UIView*)view;
+@end
+
+@implementation TPMultiLayoutViewController
+@synthesize portraitView, landscapeView;
+
+#pragma mark - View lifecycle
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ // Construct attribute tables
+ portraitAttributes = [[self attributeTableForViewHierarchy:portraitView associateWithViewHierarchy:self.view] retain];
+ landscapeAttributes = [[self attributeTableForViewHierarchy:landscapeView associateWithViewHierarchy:self.view] retain];
+ viewIsCurrentlyPortrait = (self.view == portraitView);
+
+ // Don't need to retain the original template view hierarchies any more
+ self.portraitView = nil;
+ self.landscapeView = nil;
+}
+
+- (void)viewDidUnload {
+ [super viewDidUnload];
+
+ [portraitAttributes release];
+ portraitAttributes = nil;
+ [landscapeAttributes release];
+ landscapeAttributes = nil;
+}
+
+- (void)dealloc {
+ [portraitAttributes release];
+ portraitAttributes = nil;
+ [landscapeAttributes release];
+ landscapeAttributes = nil;
+
+ [super dealloc];
+}
+
+-(void)viewWillAppear:(BOOL)animated {
+ // Display correct layout for orientation
+ if ( (UIInterfaceOrientationIsPortrait(self.interfaceOrientation) && !viewIsCurrentlyPortrait) ||
+ (UIInterfaceOrientationIsLandscape(self.interfaceOrientation) && viewIsCurrentlyPortrait) ) {
+ [self applyLayoutForInterfaceOrientation:self.interfaceOrientation];
+ }
+}
+
+#pragma mark - Rotation
+
+- (void)applyLayoutForInterfaceOrientation:(UIInterfaceOrientation)newOrientation {
+ NSDictionary *table = UIInterfaceOrientationIsPortrait(newOrientation) ? portraitAttributes : landscapeAttributes;
+ [self applyAttributeTable:table toViewHierarchy:self.view];
+ viewIsCurrentlyPortrait = UIInterfaceOrientationIsPortrait(newOrientation);
+}
+
+-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
+ if ( (UIInterfaceOrientationIsPortrait(toInterfaceOrientation) && !viewIsCurrentlyPortrait) ||
+ (UIInterfaceOrientationIsLandscape(toInterfaceOrientation) && viewIsCurrentlyPortrait) ) {
+ [self applyLayoutForInterfaceOrientation:toInterfaceOrientation];
+ }
+}
+
+#pragma mark - Helpers
+
+- (NSDictionary*)attributeTableForViewHierarchy:(UIView*)rootView associateWithViewHierarchy:(UIView*)associatedRootView {
+ NSMutableDictionary *table = [NSMutableDictionary dictionary];
+ [self addAttributesForSubviewHierarchy:rootView associatedWithSubviewHierarchy:associatedRootView toTable:table];
+ return table;
+}
+
+- (void)addAttributesForSubviewHierarchy:(UIView*)view associatedWithSubviewHierarchy:(UIView*)associatedView toTable:(NSMutableDictionary*)table {
+ [table setObject:[self attributesForView:view] forKey:[NSValue valueWithPointer:associatedView]];
+
+ if ( ![self shouldDescendIntoSubviewsOfView:view] ) return;
+
+ for ( UIView *subview in view.subviews ) {
+ UIView *associatedSubView = (view == associatedView ? subview : [self findAssociatedViewForView:subview amongViews:associatedView.subviews]);
+ if ( associatedSubView ) {
+ [self addAttributesForSubviewHierarchy:subview associatedWithSubviewHierarchy:associatedSubView toTable:table];
+ }
+ }
+}
+
+- (UIView*)findAssociatedViewForView:(UIView*)view amongViews:(NSArray*)views {
+ // First try to match tag
+ if ( view.tag != 0 ) {
+ UIView *associatedView = [[views filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"tag = %d", view.tag]] lastObject];
+ if ( associatedView ) return associatedView;
+ }
+
+ // Next, try to match class, targets and actions, if it's a control
+ if ( [view isKindOfClass:[UIControl class]] && [[(UIControl*)view allTargets] count] > 0 ) {
+ for ( UIView *otherView in views ) {
+ if ( [otherView isKindOfClass:[view class]]
+ && [[(UIControl*)otherView allTargets] isEqualToSet:[(UIControl*)view allTargets]]
+ && [(UIControl*)otherView allControlEvents] == [(UIControl*)view allControlEvents] ) {
+ // Try to match all actions and targets for each associated control event
+ BOOL allActionsMatch = YES;
+ UIControlEvents controlEvents = [(UIControl*)otherView allControlEvents];
+ for ( id target in [(UIControl*)otherView allTargets] ) {
+ // Iterate over each bit in the UIControlEvents bitfield
+ for ( NSInteger i=0; i<sizeof(UIControlEvents)*8; i++ ) {
+ UIControlEvents event = 1 << i;
+ if ( !(controlEvents & event) ) continue;
+ if ( ![[(UIControl*)otherView actionsForTarget:target forControlEvent:event] isEqualToArray:[(UIControl*)view actionsForTarget:target forControlEvent:event]] ) {
+ allActionsMatch = NO;
+ break;
+ }
+ }
+ if ( !allActionsMatch ) break;
+ }
+
+ if ( allActionsMatch ) {
+ return otherView;
+ }
+ }
+ }
+ }
+
+ // Next, try to match title or image, if it's a button
+ if ( [view isKindOfClass:[UIButton class]] ) {
+ for ( UIView *otherView in views ) {
+ if ( [otherView isKindOfClass:[view class]] && [[(UIButton*)otherView titleForState:UIControlStateNormal] isEqualToString:[(UIButton*)view titleForState:UIControlStateNormal]] ) {
+ return otherView;
+ }
+ }
+
+ for ( UIView *otherView in views ) {
+ if ( [otherView isKindOfClass:[view class]] && [(UIButton*)otherView imageForState:UIControlStateNormal] == [(UIButton*)view imageForState:UIControlStateNormal] ) {
+ return otherView;
+ }
+ }
+ }
+
+ // Try to match by title if it's a label
+ if ( [view isKindOfClass:[UILabel class]] ) {
+ for ( UIView *otherView in views ) {
+ if ( [otherView isKindOfClass:[view class]] && [[(UILabel*)otherView text] isEqualToString:[(UILabel*)view text]] ) {
+ return otherView;
+ }
+ }
+ }
+
+ // Try to match by text/placeholder if it's a text field
+ if ( [view isKindOfClass:[UITextField class]] ) {
+ for ( UIView *otherView in views ) {
+ if ( [otherView isKindOfClass:[view class]] && ([(UITextField*)view text] || [(UITextField*)view placeholder]) &&
+ ((![(UITextField*)view text] && ![(UITextField*)otherView text]) || [[(UITextField*)otherView text] isEqualToString:[(UITextField*)view text]]) &&
+ ((![(UITextField*)view placeholder] && ![(UITextField*)otherView placeholder]) || [[(UITextField*)otherView placeholder] isEqualToString:[(UITextField*)view placeholder]]) ) {
+ return otherView;
+ }
+ }
+ }
+
+ // Finally, try to match by class
+ NSArray *matches = [views filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"class = %@", [view class]]];
+ if ( [matches count] == 1 ) return [matches lastObject];
+
+#if VERBOSE_MATCH_FAIL
+ NSMutableString *path = [NSMutableString string];
+ for ( UIView *v = view.superview; v != nil; v = v.superview ) {
+ [path insertString:[NSString stringWithFormat:@"%@ => ", NSStringFromClass([v class])] atIndex:0];
+ }
+ NSLog(@"Couldn't find match for %@%@", path, NSStringFromClass([view class]));
+
+#endif
+
+ return nil;
+}
+
+- (void)applyAttributeTable:(NSDictionary*)table toViewHierarchy:(UIView*)view {
+ NSDictionary *attributes = [table objectForKey:[NSValue valueWithPointer:view]];
+ if ( attributes ) {
+ [self applyAttributes:attributes toView:view];
+ }
+
+ if ( view.hidden ) return;
+
+ if ( ![self shouldDescendIntoSubviewsOfView:view] ) return;
+
+ for ( UIView *subview in view.subviews ) {
+ [self applyAttributeTable:table toViewHierarchy:subview];
+ }
+}
+
+- (NSDictionary*)attributesForView:(UIView*)view {
+ NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
+
+ [attributes setObject:[NSValue valueWithCGRect:view.frame] forKey:@"frame"];
+ [attributes setObject:[NSValue valueWithCGRect:view.bounds] forKey:@"bounds"];
+ [attributes setObject:[NSNumber numberWithBool:view.hidden] forKey:@"hidden"];
+ [attributes setObject:[NSNumber numberWithInteger:view.autoresizingMask] forKey:@"autoresizingMask"];
+
+ return attributes;
+}
+
+- (void)applyAttributes:(NSDictionary*)attributes toView:(UIView*)view {
+ view.frame = [[attributes objectForKey:@"frame"] CGRectValue];
+ view.bounds = [[attributes objectForKey:@"bounds"] CGRectValue];
+ view.hidden = [[attributes objectForKey:@"hidden"] boolValue];
+ view.autoresizingMask = [[attributes objectForKey:@"autoresizingMask"] integerValue];
+}
+
+- (BOOL)shouldDescendIntoSubviewsOfView:(UIView*)view {
+ if ( [view isKindOfClass:[UISlider class]] ||
+ [view isKindOfClass:[UISwitch class]] ||
+ [view isKindOfClass:[UITextField class]] ||
+ [view isKindOfClass:[UIWebView class]] ||
+ [view isKindOfClass:[UITableView class]] ||
+ [view isKindOfClass:[UIPickerView class]] ||
+ [view isKindOfClass:[UIDatePicker class]] ||
+ [view isKindOfClass:[UITextView class]] ||
+ [view isKindOfClass:[UIProgressView class]] ||
+ [view isKindOfClass:[UISegmentedControl class]] ) return NO;
+ return YES;
+}
+
+@end
View
15 TPMultiLayoutViewControllerTest.xcodeproj/project.pbxproj
@@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
+ 4C37150513F82B5E004B8958 /* TPMultiLayoutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C37150413F82B5E004B8958 /* TPMultiLayoutViewController.m */; };
4C41456D13F810C9005332D6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C41456C13F810C9005332D6 /* UIKit.framework */; };
4C41456F13F810C9005332D6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C41456E13F810C9005332D6 /* Foundation.framework */; };
4C41457113F810C9005332D6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C41457013F810C9005332D6 /* CoreGraphics.framework */; };
@@ -19,18 +20,20 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
+ 4C37150313F82B5E004B8958 /* TPMultiLayoutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPMultiLayoutViewController.h; sourceTree = "<group>"; };
+ 4C37150413F82B5E004B8958 /* TPMultiLayoutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TPMultiLayoutViewController.m; sourceTree = "<group>"; };
4C41456813F810C9005332D6 /* TPMultiLayoutViewControllerTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TPMultiLayoutViewControllerTest.app; sourceTree = BUILT_PRODUCTS_DIR; };
4C41456C13F810C9005332D6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
4C41456E13F810C9005332D6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
4C41457013F810C9005332D6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
- 4C41457413F810CA005332D6 /* TPMultiLayoutViewControllerTest-Info.plist */ = {isa = PBXFileReference; path = "TPMultiLayoutViewControllerTest-Info.plist"; sourceTree = "<group>"; };
+ 4C41457413F810CA005332D6 /* TPMultiLayoutViewControllerTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TPMultiLayoutViewControllerTest-Info.plist"; sourceTree = "<group>"; };
4C41457613F810CA005332D6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
4C41457813F810CA005332D6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
- 4C41457A13F810CA005332D6 /* TPMultiLayoutViewControllerTest-Prefix.pch */ = {isa = PBXFileReference; path = "TPMultiLayoutViewControllerTest-Prefix.pch"; sourceTree = "<group>"; };
- 4C41457B13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.h */ = {isa = PBXFileReference; path = TPMultiLayoutViewControllerTestAppDelegate.h; sourceTree = "<group>"; };
+ 4C41457A13F810CA005332D6 /* TPMultiLayoutViewControllerTest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TPMultiLayoutViewControllerTest-Prefix.pch"; sourceTree = "<group>"; };
+ 4C41457B13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TPMultiLayoutViewControllerTestAppDelegate.h; sourceTree = "<group>"; };
4C41457C13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TPMultiLayoutViewControllerTestAppDelegate.m; sourceTree = "<group>"; };
4C41457F13F810CA005332D6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = "<group>"; };
- 4C41458113F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.h */ = {isa = PBXFileReference; path = TPMultiLayoutViewControllerTestViewController.h; sourceTree = "<group>"; };
+ 4C41458113F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TPMultiLayoutViewControllerTestViewController.h; sourceTree = "<group>"; };
4C41458213F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TPMultiLayoutViewControllerTestViewController.m; sourceTree = "<group>"; };
4C41458513F810CA005332D6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/TPMultiLayoutViewControllerTestViewController.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -52,6 +55,8 @@
4C41455D13F810C9005332D6 = {
isa = PBXGroup;
children = (
+ 4C37150313F82B5E004B8958 /* TPMultiLayoutViewController.h */,
+ 4C37150413F82B5E004B8958 /* TPMultiLayoutViewController.m */,
4C41457213F810C9005332D6 /* TPMultiLayoutViewControllerTest */,
4C41456B13F810C9005332D6 /* Frameworks */,
4C41456913F810C9005332D6 /* Products */,
@@ -164,6 +169,7 @@
4C41457913F810CA005332D6 /* main.m in Sources */,
4C41457D13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.m in Sources */,
4C41458313F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.m in Sources */,
+ 4C37150513F82B5E004B8958 /* TPMultiLayoutViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -281,6 +287,7 @@
4C41458B13F810CA005332D6 /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
View
7 TPMultiLayoutViewControllerTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:TPMultiLayoutViewControllerTest.xcodeproj">
+ </FileRef>
+</Workspace>
View
2 TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTestAppDelegate.h
@@ -3,7 +3,7 @@
// TPMultiLayoutViewControllerTest
//
// Created by Michael Tyson on 14/08/2011.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// Copyright 2011 A Tasty Pixel. All rights reserved.
//
#import <UIKit/UIKit.h>
View
2 TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTestAppDelegate.m
@@ -3,7 +3,7 @@
// TPMultiLayoutViewControllerTest
//
// Created by Michael Tyson on 14/08/2011.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// Copyright 2011 A Tasty Pixel. All rights reserved.
//
#import "TPMultiLayoutViewControllerTestAppDelegate.h"
View
10 TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTestViewController.h
@@ -3,11 +3,17 @@
// TPMultiLayoutViewControllerTest
//
// Created by Michael Tyson on 14/08/2011.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// Copyright 2011 A Tasty Pixel. All rights reserved.
//
#import <UIKit/UIKit.h>
+#import "TPMultiLayoutViewController.h"
-@interface TPMultiLayoutViewControllerTestViewController : UIViewController
+@interface TPMultiLayoutViewControllerTestViewController : TPMultiLayoutViewController {
+ UILabel *sliderLabel;
+}
+- (IBAction)updateSliderLabel:(id)sender;
+
+@property (nonatomic, retain) IBOutlet UILabel *sliderLabel;
@end
View
15 TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTestViewController.m
@@ -3,12 +3,13 @@
// TPMultiLayoutViewControllerTest
//
// Created by Michael Tyson on 14/08/2011.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// Copyright 2011 A Tasty Pixel. All rights reserved.
//
#import "TPMultiLayoutViewControllerTestViewController.h"
@implementation TPMultiLayoutViewControllerTestViewController
+@synthesize sliderLabel;
- (void)didReceiveMemoryWarning
{
@@ -30,6 +31,7 @@ - (void)viewDidLoad
- (void)viewDidUnload
{
+ [self setSliderLabel:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
@@ -38,7 +40,16 @@ - (void)viewDidUnload
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
- return (interfaceOrientation == UIInterfaceOrientationPortrait);
+ return YES;
+}
+
+- (void)dealloc {
+ [sliderLabel release];
+ [super dealloc];
+}
+
+- (IBAction)updateSliderLabel:(id)sender {
+ sliderLabel.text = [NSString stringWithFormat:@"%g", ((UISlider*)sender).value];
}
@end
View
681 TPMultiLayoutViewControllerTest/en.lproj/TPMultiLayoutViewControllerTestViewController.xib
@@ -1,18 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
- <int key="IBDocument.SystemTarget">800</int>
- <string key="IBDocument.SystemVersion">10C540</string>
- <string key="IBDocument.InterfaceBuilderVersion">759</string>
- <string key="IBDocument.AppKitVersion">1038.25</string>
- <string key="IBDocument.HIToolboxVersion">458.00</string>
+ <int key="IBDocument.SystemTarget">1056</int>
+ <string key="IBDocument.SystemVersion">11A511</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1617</string>
+ <string key="IBDocument.AppKitVersion">1138</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">77</string>
+ <string key="NS.object.0">534</string>
</object>
- <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="6"/>
+ <string>IBUITextField</string>
+ <string>IBUISlider</string>
+ <string>IBUIButton</string>
+ <string>IBUIView</string>
+ <string>IBUILabel</string>
+ <string>IBProxyObject</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -23,9 +28,7 @@
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
+ <reference key="dict.values" ref="0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -40,17 +43,398 @@
<object class="IBUIView" id="774585933">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
- <string key="NSFrameSize">{320, 460}</string>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUILabel" id="551229343">
+ <reference key="NSNextResponder" ref="774585933"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{29, 20}, {57, 21}}</string>
+ <reference key="NSSuperview" ref="774585933"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="641845640"/>
+ <string key="NSReuseIdentifierKey">_NS:311</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 1</string>
+ <object class="NSFont" key="IBUIFont" id="390806903">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">17</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <object class="NSColor" key="IBUITextColor" id="31292076">
+ <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>
+ <object class="IBUITextField" id="641845640">
+ <reference key="NSNextResponder" ref="774585933"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{102, 15}, {186, 31}}</string>
+ <reference key="NSSuperview" ref="774585933"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="367898585"/>
+ <string key="NSReuseIdentifierKey">_NS:294</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <string key="IBUIText">Text 1</string>
+ <int key="IBUIBorderStyle">3</int>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace" id="529094012">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
+ <float key="IBUIMinimumFontSize">17</float>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBUILabel" id="367898585">
+ <reference key="NSNextResponder" ref="774585933"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{29, 59}, {57, 21}}</string>
+ <reference key="NSSuperview" ref="774585933"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="88376000"/>
+ <string key="NSReuseIdentifierKey">_NS:311</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 2</string>
+ <reference key="IBUIFont" ref="390806903"/>
+ <reference key="IBUITextColor" ref="31292076"/>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ </object>
+ <object class="IBUITextField" id="88376000">
+ <reference key="NSNextResponder" ref="774585933"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{102, 54}, {186, 31}}</string>
+ <reference key="NSSuperview" ref="774585933"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="131651654"/>
+ <string key="NSReuseIdentifierKey">_NS:294</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <string key="IBUIText">Text 2</string>
+ <int key="IBUIBorderStyle">3</int>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ <reference key="NSCustomColorSpace" ref="529094012"/>
+ </object>
+ <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
+ <float key="IBUIMinimumFontSize">17</float>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBUIButton" id="131651654">
+ <reference key="NSNextResponder" ref="774585933"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{29, 167}, {107, 115}}</string>
+ <reference key="NSSuperview" ref="774585933"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="830519548"/>
+ <string key="NSReuseIdentifierKey">_NS:222</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <object class="NSFont" key="IBUIFont" id="308752132">
+ <string key="NSName">Helvetica-Bold</string>
+ <double key="NSSize">15</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <int key="IBUIButtonType">1</int>
+ <string key="IBUINormalTitle">A</string>
+ <object class="NSColor" key="IBUIHighlightedTitleColor" id="675214983">
+ <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" id="197873870">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC41AA</bytes>
+ </object>
+ </object>
+ <object class="IBUIButton" id="830519548">
+ <reference key="NSNextResponder" ref="774585933"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{181, 167}, {107, 115}}</string>
+ <reference key="NSSuperview" ref="774585933"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="951307503"/>
+ <string key="NSReuseIdentifierKey">_NS:222</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <reference key="IBUIFont" ref="308752132"/>
+ <int key="IBUIButtonType">1</int>
+ <string key="IBUINormalTitle">B</string>
+ <reference key="IBUIHighlightedTitleColor" ref="675214983"/>
+ <object class="NSColor" key="IBUINormalTitleColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+ </object>
+ <reference key="IBUINormalTitleShadowColor" ref="197873870"/>
+ </object>
+ <object class="IBUISlider" id="3306263">
+ <reference key="NSNextResponder" ref="774585933"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{42, 395}, {236, 23}}</string>
+ <reference key="NSSuperview" ref="774585933"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <string key="NSReuseIdentifierKey">_NS:605</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <float key="IBUIValue">0.5</float>
+ </object>
+ <object class="IBUILabel" id="951307503">
+ <reference key="NSNextResponder" ref="774585933"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{44, 350}, {232, 21}}</string>
+ <reference key="NSSuperview" ref="774585933"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="3306263"/>
+ <string key="NSReuseIdentifierKey">_NS:311</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>
+ <reference key="IBUITextColor" ref="31292076"/>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ <int key="IBUITextAlignment">1</int>
+ </object>
+ </object>
+ <string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="551229343"/>
<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>
+ <reference key="NSCustomColorSpace" ref="529094012"/>
+ </object>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="37400504">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUILabel" id="448081225">
+ <reference key="NSNextResponder" ref="37400504"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{23, 27}, {57, 21}}</string>
+ <reference key="NSSuperview" ref="37400504"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="795952665"/>
+ <string key="NSReuseIdentifierKey">_NS:311</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 1</string>
+ <reference key="IBUIFont" ref="390806903"/>
+ <reference key="IBUITextColor" ref="31292076"/>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ </object>
+ <object class="IBUITextField" id="795952665">
+ <reference key="NSNextResponder" ref="37400504"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{89, 20}, {359, 31}}</string>
+ <reference key="NSSuperview" ref="37400504"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="686317664"/>
+ <string key="NSReuseIdentifierKey">_NS:294</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <string key="IBUIText">Text 1</string>
+ <int key="IBUIBorderStyle">3</int>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ <reference key="NSCustomColorSpace" ref="529094012"/>
+ </object>
+ <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
+ <float key="IBUIMinimumFontSize">17</float>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBUILabel" id="686317664">
+ <reference key="NSNextResponder" ref="37400504"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{23, 66}, {57, 21}}</string>
+ <reference key="NSSuperview" ref="37400504"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="609811711"/>
+ <string key="NSReuseIdentifierKey">_NS:311</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 2</string>
+ <reference key="IBUIFont" ref="390806903"/>
+ <reference key="IBUITextColor" ref="31292076"/>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ </object>
+ <object class="IBUITextField" id="609811711">
+ <reference key="NSNextResponder" ref="37400504"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{89, 59}, {359, 31}}</string>
+ <reference key="NSSuperview" ref="37400504"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="461735262"/>
+ <string key="NSReuseIdentifierKey">_NS:294</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <string key="IBUIText">Text 2</string>
+ <int key="IBUIBorderStyle">3</int>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ <reference key="NSCustomColorSpace" ref="529094012"/>
+ </object>
+ <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
+ <float key="IBUIMinimumFontSize">17</float>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBUIButton" id="461735262">
+ <reference key="NSNextResponder" ref="37400504"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 121}, {180, 70}}</string>
+ <reference key="NSSuperview" ref="37400504"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="874148184"/>
+ <string key="NSReuseIdentifierKey">_NS:222</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <reference key="IBUIFont" ref="308752132"/>
+ <int key="IBUIButtonType">1</int>
+ <string key="IBUINormalTitle">A</string>
+ <reference key="IBUIHighlightedTitleColor" ref="675214983"/>
+ <object class="NSColor" key="IBUINormalTitleColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+ </object>
+ <reference key="IBUINormalTitleShadowColor" ref="197873870"/>
</object>
+ <object class="IBUIButton" id="819155992">
+ <reference key="NSNextResponder" ref="37400504"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 209}, {180, 71}}</string>
+ <reference key="NSSuperview" ref="37400504"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="636976621"/>
+ <string key="NSReuseIdentifierKey">_NS:222</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <reference key="IBUIFont" ref="308752132"/>
+ <int key="IBUIButtonType">1</int>
+ <string key="IBUINormalTitle">B</string>
+ <reference key="IBUIHighlightedTitleColor" ref="675214983"/>
+ <object class="NSColor" key="IBUINormalTitleColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+ </object>
+ <reference key="IBUINormalTitleShadowColor" ref="197873870"/>
+ </object>
+ <object class="IBUISlider" id="636976621">
+ <reference key="NSNextResponder" ref="37400504"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{226, 201}, {236, 23}}</string>
+ <reference key="NSSuperview" ref="37400504"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <string key="NSReuseIdentifierKey">_NS:605</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <float key="IBUIValue">0.5</float>
+ </object>
+ <object class="IBUILabel" id="874148184">
+ <reference key="NSNextResponder" ref="37400504"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{228, 150}, {232, 21}}</string>
+ <reference key="NSSuperview" ref="37400504"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="819155992"/>
+ <string key="NSReuseIdentifierKey">_NS:311</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>
+ <reference key="IBUITextColor" ref="31292076"/>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ <int key="IBUITextAlignment">1</int>
+ </object>
+ </object>
+ <string key="NSFrame">{{0, 20}, {480, 300}}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="448081225"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC43NQA</bytes>
+ <reference key="NSCustomColorSpace" ref="529094012"/>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
+ <int key="IBUIInterfaceOrientation">3</int>
+ <int key="interfaceOrientation">3</int>
+ </object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
@@ -65,6 +449,48 @@
</object>
<int key="connectionID">7</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">portraitView</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="774585933"/>
+ </object>
+ <int key="connectionID">17</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">landscapeView</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="37400504"/>
+ </object>
+ <int key="connectionID">18</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">sliderLabel</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="951307503"/>
+ </object>
+ <int key="connectionID">19</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">updateSliderLabel:</string>
+ <reference key="source" ref="3306263"/>
+ <reference key="destination" ref="372490531"/>
+ <int key="IBEventType">13</int>
+ </object>
+ <int key="connectionID">20</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">updateSliderLabel:</string>
+ <reference key="source" ref="636976621"/>
+ <reference key="destination" ref="372490531"/>
+ <int key="IBEventType">13</int>
+ </object>
+ <int key="connectionID">29</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -89,54 +515,255 @@
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="774585933"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="641845640"/>
+ <reference ref="88376000"/>
+ <reference ref="131651654"/>
+ <reference ref="830519548"/>
+ <reference ref="3306263"/>
+ <reference ref="951307503"/>
+ <reference ref="551229343"/>
+ <reference ref="367898585"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">8</int>
+ <reference key="object" ref="37400504"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="795952665"/>
+ <reference ref="609811711"/>
+ <reference ref="819155992"/>
+ <reference ref="461735262"/>
+ <reference ref="636976621"/>
+ <reference ref="874148184"/>
+ <reference ref="448081225"/>
+ <reference ref="686317664"/>
+ </object>
<reference key="parent" ref="0"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">9</int>
+ <reference key="object" ref="551229343"/>
+ <reference key="parent" ref="774585933"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">10</int>
+ <reference key="object" ref="641845640"/>
+ <reference key="parent" ref="774585933"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">11</int>
+ <reference key="object" ref="367898585"/>
+ <reference key="parent" ref="774585933"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">12</int>
+ <reference key="object" ref="88376000"/>
+ <reference key="parent" ref="774585933"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">13</int>
+ <reference key="object" ref="131651654"/>
+ <reference key="parent" ref="774585933"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">14</int>
+ <reference key="object" ref="830519548"/>
+ <reference key="parent" ref="774585933"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">15</int>
+ <reference key="object" ref="3306263"/>
+ <reference key="parent" ref="774585933"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">16</int>
+ <reference key="object" ref="951307503"/>
+ <reference key="parent" ref="774585933"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">21</int>
+ <reference key="object" ref="448081225"/>
+ <reference key="parent" ref="37400504"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">22</int>
+ <reference key="object" ref="795952665"/>
+ <reference key="parent" ref="37400504"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">23</int>
+ <reference key="object" ref="686317664"/>
+ <reference key="parent" ref="37400504"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">24</int>
+ <reference key="object" ref="609811711"/>
+ <reference key="parent" ref="37400504"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">25</int>
+ <reference key="object" ref="461735262"/>
+ <reference key="parent" ref="37400504"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">26</int>
+ <reference key="object" ref="819155992"/>
+ <reference key="parent" ref="37400504"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">27</int>
+ <reference key="object" ref="636976621"/>
+ <reference key="parent" ref="37400504"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">28</int>
+ <reference key="object" ref="874148184"/>
+ <reference key="parent" ref="37400504"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
+ <string>-1.IBPluginDependency</string>
<string>-2.CustomClassName</string>
- <string>6.IBEditorWindowLastContentRect</string>
+ <string>-2.IBPluginDependency</string>
+ <string>10.IBPluginDependency</string>
+ <string>11.IBPluginDependency</string>
+ <string>12.IBPluginDependency</string>
+ <string>13.IBPluginDependency</string>
+ <string>14.IBPluginDependency</string>
+ <string>15.IBPluginDependency</string>
+ <string>16.IBPluginDependency</string>
+ <string>21.IBPluginDependency</string>
+ <string>22.IBPluginDependency</string>
+ <string>23.IBPluginDependency</string>
+ <string>24.IBPluginDependency</string>
+ <string>25.IBPluginDependency</string>
+ <string>26.IBPluginDependency</string>
+ <string>27.IBPluginDependency</string>
+ <string>28.IBPluginDependency</string>
<string>6.IBPluginDependency</string>
+ <string>8.IBPluginDependency</string>
+ <string>9.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>TPMultiLayoutViewControllerTestViewController</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIResponder</string>
- <string>{{239, 654}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
+ <reference key="dict.values" ref="0"/>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
+ <reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
- <int key="maxID">7</int>
+ <int key="maxID">29</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
- <string key="className">TPMultiLayoutViewControllerTestViewController</string>
+ <string key="className">TPMultiLayoutViewController</string>
<string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>landscapeView</string>
+ <string>portraitView</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UIView</string>
+ <string>UIView</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>landscapeView</string>
+ <string>portraitView</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">landscapeView</string>
+ <string key="candidateClassName">UIView</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">portraitView</string>
+ <string key="candidateClassName">UIView</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/TPMultiLayoutViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">TPMultiLayoutViewControllerTestViewController</string>
+ <string key="superclassName">TPMultiLayoutViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">updateSliderLabel:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">updateSliderLabel:</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">updateSliderLabel:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">sliderLabel</string>
+ <string key="NS.object.0">UILabel</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">sliderLabel</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">sliderLabel</string>
+ <string key="candidateClassName">UILabel</string>
+ </object>
+ </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
- <string key="minorKey">TPMultiLayoutViewControllerTestViewController.h</string>
+ <string key="minorKey">./Classes/TPMultiLayoutViewControllerTestViewController.h</string>
</object>
</object>
</object>
@@ -148,9 +775,7 @@
<integer value="3100" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
- <string key="IBDocument.LastKnownRelativeProjectPath">TPMultiLayoutViewControllerTest.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">77</string>
- <nil key="IBCocoaTouchSimulationTargetRuntimeIdentifier"/>
+ <string key="IBCocoaTouchPluginVersion">534</string>
</data>
</archive>
View
2 TPMultiLayoutViewControllerTest/main.m
@@ -3,7 +3,7 @@
// TPMultiLayoutViewControllerTest
//
// Created by Michael Tyson on 14/08/2011.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// Copyright 2011 A Tasty Pixel. All rights reserved.
//
#import <UIKit/UIKit.h>

0 comments on commit 5490ded

Please sign in to comment.
Something went wrong with that request. Please try again.