├── .gitignore ├── README.markdown ├── TPMultiLayoutViewController.h ├── TPMultiLayoutViewController.m ├── TPMultiLayoutViewControllerTest.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata └── TPMultiLayoutViewControllerTest ├── TPMultiLayoutViewControllerTest-Info.plist ├── TPMultiLayoutViewControllerTest-Prefix.pch ├── TPMultiLayoutViewControllerTestAppDelegate.h ├── TPMultiLayoutViewControllerTestAppDelegate.m ├── TPMultiLayoutViewControllerTestViewController.h ├── TPMultiLayoutViewControllerTestViewController.m ├── en.lproj ├── InfoPlist.strings ├── MainWindow.xib └── TPMultiLayoutViewControllerTestViewController.xib └── main.m /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | xcuserdata -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /TPMultiLayoutViewController.h: -------------------------------------------------------------------------------- 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 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 26 | -------------------------------------------------------------------------------- /TPMultiLayoutViewController.m: -------------------------------------------------------------------------------- 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 ", 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 -------------------------------------------------------------------------------- /TPMultiLayoutViewControllerTest.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4C37150513F82B5E004B8958 /* TPMultiLayoutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C37150413F82B5E004B8958 /* TPMultiLayoutViewController.m */; }; 11 | 4C41456D13F810C9005332D6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C41456C13F810C9005332D6 /* UIKit.framework */; }; 12 | 4C41456F13F810C9005332D6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C41456E13F810C9005332D6 /* Foundation.framework */; }; 13 | 4C41457113F810C9005332D6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C41457013F810C9005332D6 /* CoreGraphics.framework */; }; 14 | 4C41457713F810CA005332D6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4C41457513F810CA005332D6 /* InfoPlist.strings */; }; 15 | 4C41457913F810CA005332D6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C41457813F810CA005332D6 /* main.m */; }; 16 | 4C41457D13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C41457C13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.m */; }; 17 | 4C41458013F810CA005332D6 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C41457E13F810CA005332D6 /* MainWindow.xib */; }; 18 | 4C41458313F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C41458213F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.m */; }; 19 | 4C41458613F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C41458413F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.xib */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 4C37150313F82B5E004B8958 /* TPMultiLayoutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPMultiLayoutViewController.h; sourceTree = ""; }; 24 | 4C37150413F82B5E004B8958 /* TPMultiLayoutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TPMultiLayoutViewController.m; sourceTree = ""; }; 25 | 4C41456813F810C9005332D6 /* TPMultiLayoutViewControllerTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TPMultiLayoutViewControllerTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | 4C41456C13F810C9005332D6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 27 | 4C41456E13F810C9005332D6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 28 | 4C41457013F810C9005332D6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 29 | 4C41457413F810CA005332D6 /* TPMultiLayoutViewControllerTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TPMultiLayoutViewControllerTest-Info.plist"; sourceTree = ""; }; 30 | 4C41457613F810CA005332D6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 31 | 4C41457813F810CA005332D6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32 | 4C41457A13F810CA005332D6 /* TPMultiLayoutViewControllerTest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TPMultiLayoutViewControllerTest-Prefix.pch"; sourceTree = ""; }; 33 | 4C41457B13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TPMultiLayoutViewControllerTestAppDelegate.h; sourceTree = ""; }; 34 | 4C41457C13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TPMultiLayoutViewControllerTestAppDelegate.m; sourceTree = ""; }; 35 | 4C41457F13F810CA005332D6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = ""; }; 36 | 4C41458113F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TPMultiLayoutViewControllerTestViewController.h; sourceTree = ""; }; 37 | 4C41458213F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TPMultiLayoutViewControllerTestViewController.m; sourceTree = ""; }; 38 | 4C41458513F810CA005332D6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/TPMultiLayoutViewControllerTestViewController.xib; sourceTree = ""; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | 4C41456513F810C9005332D6 /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | 4C41456D13F810C9005332D6 /* UIKit.framework in Frameworks */, 47 | 4C41456F13F810C9005332D6 /* Foundation.framework in Frameworks */, 48 | 4C41457113F810C9005332D6 /* CoreGraphics.framework in Frameworks */, 49 | ); 50 | runOnlyForDeploymentPostprocessing = 0; 51 | }; 52 | /* End PBXFrameworksBuildPhase section */ 53 | 54 | /* Begin PBXGroup section */ 55 | 4C41455D13F810C9005332D6 = { 56 | isa = PBXGroup; 57 | children = ( 58 | 4C37150313F82B5E004B8958 /* TPMultiLayoutViewController.h */, 59 | 4C37150413F82B5E004B8958 /* TPMultiLayoutViewController.m */, 60 | 4C41457213F810C9005332D6 /* TPMultiLayoutViewControllerTest */, 61 | 4C41456B13F810C9005332D6 /* Frameworks */, 62 | 4C41456913F810C9005332D6 /* Products */, 63 | ); 64 | sourceTree = ""; 65 | }; 66 | 4C41456913F810C9005332D6 /* Products */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 4C41456813F810C9005332D6 /* TPMultiLayoutViewControllerTest.app */, 70 | ); 71 | name = Products; 72 | sourceTree = ""; 73 | }; 74 | 4C41456B13F810C9005332D6 /* Frameworks */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 4C41456C13F810C9005332D6 /* UIKit.framework */, 78 | 4C41456E13F810C9005332D6 /* Foundation.framework */, 79 | 4C41457013F810C9005332D6 /* CoreGraphics.framework */, 80 | ); 81 | name = Frameworks; 82 | sourceTree = ""; 83 | }; 84 | 4C41457213F810C9005332D6 /* TPMultiLayoutViewControllerTest */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 4C41457B13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.h */, 88 | 4C41457C13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.m */, 89 | 4C41457E13F810CA005332D6 /* MainWindow.xib */, 90 | 4C41458113F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.h */, 91 | 4C41458213F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.m */, 92 | 4C41458413F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.xib */, 93 | 4C41457313F810C9005332D6 /* Supporting Files */, 94 | ); 95 | path = TPMultiLayoutViewControllerTest; 96 | sourceTree = ""; 97 | }; 98 | 4C41457313F810C9005332D6 /* Supporting Files */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 4C41457413F810CA005332D6 /* TPMultiLayoutViewControllerTest-Info.plist */, 102 | 4C41457513F810CA005332D6 /* InfoPlist.strings */, 103 | 4C41457813F810CA005332D6 /* main.m */, 104 | 4C41457A13F810CA005332D6 /* TPMultiLayoutViewControllerTest-Prefix.pch */, 105 | ); 106 | name = "Supporting Files"; 107 | sourceTree = ""; 108 | }; 109 | /* End PBXGroup section */ 110 | 111 | /* Begin PBXNativeTarget section */ 112 | 4C41456713F810C9005332D6 /* TPMultiLayoutViewControllerTest */ = { 113 | isa = PBXNativeTarget; 114 | buildConfigurationList = 4C41458913F810CA005332D6 /* Build configuration list for PBXNativeTarget "TPMultiLayoutViewControllerTest" */; 115 | buildPhases = ( 116 | 4C41456413F810C9005332D6 /* Sources */, 117 | 4C41456513F810C9005332D6 /* Frameworks */, 118 | 4C41456613F810C9005332D6 /* Resources */, 119 | ); 120 | buildRules = ( 121 | ); 122 | dependencies = ( 123 | ); 124 | name = TPMultiLayoutViewControllerTest; 125 | productName = TPMultiLayoutViewControllerTest; 126 | productReference = 4C41456813F810C9005332D6 /* TPMultiLayoutViewControllerTest.app */; 127 | productType = "com.apple.product-type.application"; 128 | }; 129 | /* End PBXNativeTarget section */ 130 | 131 | /* Begin PBXProject section */ 132 | 4C41455F13F810C9005332D6 /* Project object */ = { 133 | isa = PBXProject; 134 | buildConfigurationList = 4C41456213F810C9005332D6 /* Build configuration list for PBXProject "TPMultiLayoutViewControllerTest" */; 135 | compatibilityVersion = "Xcode 3.2"; 136 | developmentRegion = English; 137 | hasScannedForEncodings = 0; 138 | knownRegions = ( 139 | en, 140 | ); 141 | mainGroup = 4C41455D13F810C9005332D6; 142 | productRefGroup = 4C41456913F810C9005332D6 /* Products */; 143 | projectDirPath = ""; 144 | projectRoot = ""; 145 | targets = ( 146 | 4C41456713F810C9005332D6 /* TPMultiLayoutViewControllerTest */, 147 | ); 148 | }; 149 | /* End PBXProject section */ 150 | 151 | /* Begin PBXResourcesBuildPhase section */ 152 | 4C41456613F810C9005332D6 /* Resources */ = { 153 | isa = PBXResourcesBuildPhase; 154 | buildActionMask = 2147483647; 155 | files = ( 156 | 4C41457713F810CA005332D6 /* InfoPlist.strings in Resources */, 157 | 4C41458013F810CA005332D6 /* MainWindow.xib in Resources */, 158 | 4C41458613F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.xib in Resources */, 159 | ); 160 | runOnlyForDeploymentPostprocessing = 0; 161 | }; 162 | /* End PBXResourcesBuildPhase section */ 163 | 164 | /* Begin PBXSourcesBuildPhase section */ 165 | 4C41456413F810C9005332D6 /* Sources */ = { 166 | isa = PBXSourcesBuildPhase; 167 | buildActionMask = 2147483647; 168 | files = ( 169 | 4C41457913F810CA005332D6 /* main.m in Sources */, 170 | 4C41457D13F810CA005332D6 /* TPMultiLayoutViewControllerTestAppDelegate.m in Sources */, 171 | 4C41458313F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.m in Sources */, 172 | 4C37150513F82B5E004B8958 /* TPMultiLayoutViewController.m in Sources */, 173 | ); 174 | runOnlyForDeploymentPostprocessing = 0; 175 | }; 176 | /* End PBXSourcesBuildPhase section */ 177 | 178 | /* Begin PBXVariantGroup section */ 179 | 4C41457513F810CA005332D6 /* InfoPlist.strings */ = { 180 | isa = PBXVariantGroup; 181 | children = ( 182 | 4C41457613F810CA005332D6 /* en */, 183 | ); 184 | name = InfoPlist.strings; 185 | sourceTree = ""; 186 | }; 187 | 4C41457E13F810CA005332D6 /* MainWindow.xib */ = { 188 | isa = PBXVariantGroup; 189 | children = ( 190 | 4C41457F13F810CA005332D6 /* en */, 191 | ); 192 | name = MainWindow.xib; 193 | sourceTree = ""; 194 | }; 195 | 4C41458413F810CA005332D6 /* TPMultiLayoutViewControllerTestViewController.xib */ = { 196 | isa = PBXVariantGroup; 197 | children = ( 198 | 4C41458513F810CA005332D6 /* en */, 199 | ); 200 | name = TPMultiLayoutViewControllerTestViewController.xib; 201 | sourceTree = ""; 202 | }; 203 | /* End PBXVariantGroup section */ 204 | 205 | /* Begin XCBuildConfiguration section */ 206 | 4C41458713F810CA005332D6 /* Debug */ = { 207 | isa = XCBuildConfiguration; 208 | buildSettings = { 209 | ALWAYS_SEARCH_USER_PATHS = NO; 210 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 211 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 212 | COPY_PHASE_STRIP = NO; 213 | GCC_C_LANGUAGE_STANDARD = gnu99; 214 | GCC_DYNAMIC_NO_PIC = NO; 215 | GCC_OPTIMIZATION_LEVEL = 0; 216 | GCC_PREPROCESSOR_DEFINITIONS = ( 217 | "DEBUG=1", 218 | "$(inherited)", 219 | ); 220 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 221 | GCC_VERSION = com.apple.compilers.llvmgcc42; 222 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 223 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 224 | GCC_WARN_UNUSED_VARIABLE = YES; 225 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 226 | SDKROOT = iphoneos; 227 | }; 228 | name = Debug; 229 | }; 230 | 4C41458813F810CA005332D6 /* Release */ = { 231 | isa = XCBuildConfiguration; 232 | buildSettings = { 233 | ALWAYS_SEARCH_USER_PATHS = NO; 234 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 235 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 236 | COPY_PHASE_STRIP = YES; 237 | GCC_C_LANGUAGE_STANDARD = gnu99; 238 | GCC_VERSION = com.apple.compilers.llvmgcc42; 239 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 240 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 241 | GCC_WARN_UNUSED_VARIABLE = YES; 242 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 243 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 244 | SDKROOT = iphoneos; 245 | VALIDATE_PRODUCT = YES; 246 | }; 247 | name = Release; 248 | }; 249 | 4C41458A13F810CA005332D6 /* Debug */ = { 250 | isa = XCBuildConfiguration; 251 | buildSettings = { 252 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 253 | GCC_PREFIX_HEADER = "TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTest-Prefix.pch"; 254 | INFOPLIST_FILE = "TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTest-Info.plist"; 255 | PRODUCT_NAME = "$(TARGET_NAME)"; 256 | WRAPPER_EXTENSION = app; 257 | }; 258 | name = Debug; 259 | }; 260 | 4C41458B13F810CA005332D6 /* Release */ = { 261 | isa = XCBuildConfiguration; 262 | buildSettings = { 263 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 264 | GCC_PREFIX_HEADER = "TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTest-Prefix.pch"; 265 | INFOPLIST_FILE = "TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTest-Info.plist"; 266 | PRODUCT_NAME = "$(TARGET_NAME)"; 267 | WRAPPER_EXTENSION = app; 268 | }; 269 | name = Release; 270 | }; 271 | /* End XCBuildConfiguration section */ 272 | 273 | /* Begin XCConfigurationList section */ 274 | 4C41456213F810C9005332D6 /* Build configuration list for PBXProject "TPMultiLayoutViewControllerTest" */ = { 275 | isa = XCConfigurationList; 276 | buildConfigurations = ( 277 | 4C41458713F810CA005332D6 /* Debug */, 278 | 4C41458813F810CA005332D6 /* Release */, 279 | ); 280 | defaultConfigurationIsVisible = 0; 281 | defaultConfigurationName = Release; 282 | }; 283 | 4C41458913F810CA005332D6 /* Build configuration list for PBXNativeTarget "TPMultiLayoutViewControllerTest" */ = { 284 | isa = XCConfigurationList; 285 | buildConfigurations = ( 286 | 4C41458A13F810CA005332D6 /* Debug */, 287 | 4C41458B13F810CA005332D6 /* Release */, 288 | ); 289 | defaultConfigurationIsVisible = 0; 290 | defaultConfigurationName = Release; 291 | }; 292 | /* End XCConfigurationList section */ 293 | }; 294 | rootObject = 4C41455F13F810C9005332D6 /* Project object */; 295 | } 296 | -------------------------------------------------------------------------------- /TPMultiLayoutViewControllerTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTest-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.atastypixel.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTest-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'TPMultiLayoutViewControllerTest' target in the 'TPMultiLayoutViewControllerTest' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTestAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // TPMultiLayoutViewControllerTestAppDelegate.h 3 | // TPMultiLayoutViewControllerTest 4 | // 5 | // Created by Michael Tyson on 14/08/2011. 6 | // Copyright 2011 A Tasty Pixel. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TPMultiLayoutViewControllerTestViewController; 12 | 13 | @interface TPMultiLayoutViewControllerTestAppDelegate : NSObject 14 | 15 | @property (nonatomic, retain) IBOutlet UIWindow *window; 16 | 17 | @property (nonatomic, retain) IBOutlet TPMultiLayoutViewControllerTestViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTestAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // TPMultiLayoutViewControllerTestAppDelegate.m 3 | // TPMultiLayoutViewControllerTest 4 | // 5 | // Created by Michael Tyson on 14/08/2011. 6 | // Copyright 2011 A Tasty Pixel. All rights reserved. 7 | // 8 | 9 | #import "TPMultiLayoutViewControllerTestAppDelegate.h" 10 | 11 | #import "TPMultiLayoutViewControllerTestViewController.h" 12 | 13 | @implementation TPMultiLayoutViewControllerTestAppDelegate 14 | 15 | @synthesize window = _window; 16 | @synthesize viewController = _viewController; 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 19 | { 20 | // Override point for customization after application launch. 21 | 22 | self.window.rootViewController = self.viewController; 23 | [self.window makeKeyAndVisible]; 24 | return YES; 25 | } 26 | 27 | - (void)applicationWillResignActive:(UIApplication *)application 28 | { 29 | /* 30 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 31 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 32 | */ 33 | } 34 | 35 | - (void)applicationDidEnterBackground:(UIApplication *)application 36 | { 37 | /* 38 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 39 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 40 | */ 41 | } 42 | 43 | - (void)applicationWillEnterForeground:(UIApplication *)application 44 | { 45 | /* 46 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 47 | */ 48 | } 49 | 50 | - (void)applicationDidBecomeActive:(UIApplication *)application 51 | { 52 | /* 53 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 54 | */ 55 | } 56 | 57 | - (void)applicationWillTerminate:(UIApplication *)application 58 | { 59 | /* 60 | Called when the application is about to terminate. 61 | Save data if appropriate. 62 | See also applicationDidEnterBackground:. 63 | */ 64 | } 65 | 66 | - (void)dealloc 67 | { 68 | [_window release]; 69 | [_viewController release]; 70 | [super dealloc]; 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTestViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TPMultiLayoutViewControllerTestViewController.h 3 | // TPMultiLayoutViewControllerTest 4 | // 5 | // Created by Michael Tyson on 14/08/2011. 6 | // Copyright 2011 A Tasty Pixel. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TPMultiLayoutViewController.h" 11 | 12 | @interface TPMultiLayoutViewControllerTestViewController : TPMultiLayoutViewController { 13 | UILabel *sliderLabel; 14 | } 15 | 16 | - (IBAction)updateSliderLabel:(id)sender; 17 | 18 | @property (nonatomic, retain) IBOutlet UILabel *sliderLabel; 19 | @end 20 | -------------------------------------------------------------------------------- /TPMultiLayoutViewControllerTest/TPMultiLayoutViewControllerTestViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TPMultiLayoutViewControllerTestViewController.m 3 | // TPMultiLayoutViewControllerTest 4 | // 5 | // Created by Michael Tyson on 14/08/2011. 6 | // Copyright 2011 A Tasty Pixel. All rights reserved. 7 | // 8 | 9 | #import "TPMultiLayoutViewControllerTestViewController.h" 10 | 11 | @implementation TPMultiLayoutViewControllerTestViewController 12 | @synthesize sliderLabel; 13 | 14 | - (void)didReceiveMemoryWarning 15 | { 16 | // Releases the view if it doesn't have a superview. 17 | [super didReceiveMemoryWarning]; 18 | 19 | // Release any cached data, images, etc that aren't in use. 20 | } 21 | 22 | #pragma mark - View lifecycle 23 | 24 | /* 25 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 26 | - (void)viewDidLoad 27 | { 28 | [super viewDidLoad]; 29 | } 30 | */ 31 | 32 | - (void)viewDidUnload 33 | { 34 | [self setSliderLabel:nil]; 35 | [super viewDidUnload]; 36 | // Release any retained subviews of the main view. 37 | // e.g. self.myOutlet = nil; 38 | } 39 | 40 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 41 | { 42 | // Return YES for supported orientations 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]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /TPMultiLayoutViewControllerTest/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /TPMultiLayoutViewControllerTest/en.lproj/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10D571 6 | 786 7 | 1038.29 8 | 460.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 112 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | IBCocoaTouchFramework 42 | 43 | 44 | TPMultiLayoutViewControllerTestViewController 45 | 46 | 47 | 1 48 | 49 | IBCocoaTouchFramework 50 | NO 51 | 52 | 53 | 54 | 292 55 | {320, 480} 56 | 57 | 1 58 | MSAxIDEAA 59 | 60 | NO 61 | NO 62 | 63 | IBCocoaTouchFramework 64 | YES 65 | 66 | 67 | 68 | 69 | YES 70 | 71 | 72 | delegate 73 | 74 | 75 | 76 | 4 77 | 78 | 79 | 80 | viewController 81 | 82 | 83 | 84 | 11 85 | 86 | 87 | 88 | window 89 | 90 | 91 | 92 | 14 93 | 94 | 95 | 96 | 97 | YES 98 | 99 | 0 100 | 101 | 102 | 103 | 104 | 105 | -1 106 | 107 | 108 | File's Owner 109 | 110 | 111 | 3 112 | 113 | 114 | TPMultiLayoutViewControllerTest App Delegate 115 | 116 | 117 | -2 118 | 119 | 120 | 121 | 122 | 10 123 | 124 | 125 | 126 | 127 | 12 128 | 129 | 130 | 131 | 132 | 133 | 134 | YES 135 | 136 | YES 137 | -1.CustomClassName 138 | -2.CustomClassName 139 | 10.CustomClassName 140 | 10.IBEditorWindowLastContentRect 141 | 10.IBPluginDependency 142 | 12.IBEditorWindowLastContentRect 143 | 12.IBPluginDependency 144 | 3.CustomClassName 145 | 3.IBPluginDependency 146 | 147 | 148 | YES 149 | UIApplication 150 | UIResponder 151 | TPMultiLayoutViewControllerTestViewController 152 | {{234, 376}, {320, 480}} 153 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 154 | {{525, 346}, {320, 480}} 155 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 156 | TPMultiLayoutViewControllerTestAppDelegate 157 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 158 | 159 | 160 | 161 | YES 162 | 163 | 164 | YES 165 | 166 | 167 | 168 | 169 | YES 170 | 171 | 172 | YES 173 | 174 | 175 | 176 | 15 177 | 178 | 179 | 180 | YES 181 | 182 | UIWindow 183 | UIView 184 | 185 | IBUserSource 186 | 187 | 188 | 189 | 190 | TPMultiLayoutViewControllerTestAppDelegate 191 | NSObject 192 | 193 | YES 194 | 195 | YES 196 | viewController 197 | window 198 | 199 | 200 | YES 201 | TPMultiLayoutViewControllerTestViewController 202 | UIWindow 203 | 204 | 205 | 206 | YES 207 | 208 | YES 209 | viewController 210 | window 211 | 212 | 213 | YES 214 | 215 | viewController 216 | TPMultiLayoutViewControllerTestViewController 217 | 218 | 219 | window 220 | UIWindow 221 | 222 | 223 | 224 | 225 | IBProjectSource 226 | TPMultiLayoutViewControllerTestAppDelegate.h 227 | 228 | 229 | 230 | TPMultiLayoutViewControllerTestAppDelegate 231 | NSObject 232 | 233 | IBUserSource 234 | 235 | 236 | 237 | 238 | TPMultiLayoutViewControllerTestViewController 239 | UIViewController 240 | 241 | IBProjectSource 242 | TPMultiLayoutViewControllerTestViewController.h 243 | 244 | 245 | 246 | 247 | YES 248 | 249 | NSObject 250 | 251 | IBFrameworkSource 252 | Foundation.framework/Headers/NSError.h 253 | 254 | 255 | 256 | NSObject 257 | 258 | IBFrameworkSource 259 | Foundation.framework/Headers/NSFileManager.h 260 | 261 | 262 | 263 | NSObject 264 | 265 | IBFrameworkSource 266 | Foundation.framework/Headers/NSKeyValueCoding.h 267 | 268 | 269 | 270 | NSObject 271 | 272 | IBFrameworkSource 273 | Foundation.framework/Headers/NSKeyValueObserving.h 274 | 275 | 276 | 277 | NSObject 278 | 279 | IBFrameworkSource 280 | Foundation.framework/Headers/NSKeyedArchiver.h 281 | 282 | 283 | 284 | NSObject 285 | 286 | IBFrameworkSource 287 | Foundation.framework/Headers/NSObject.h 288 | 289 | 290 | 291 | NSObject 292 | 293 | IBFrameworkSource 294 | Foundation.framework/Headers/NSRunLoop.h 295 | 296 | 297 | 298 | NSObject 299 | 300 | IBFrameworkSource 301 | Foundation.framework/Headers/NSThread.h 302 | 303 | 304 | 305 | NSObject 306 | 307 | IBFrameworkSource 308 | Foundation.framework/Headers/NSURL.h 309 | 310 | 311 | 312 | NSObject 313 | 314 | IBFrameworkSource 315 | Foundation.framework/Headers/NSURLConnection.h 316 | 317 | 318 | 319 | NSObject 320 | 321 | IBFrameworkSource 322 | UIKit.framework/Headers/UIAccessibility.h 323 | 324 | 325 | 326 | NSObject 327 | 328 | IBFrameworkSource 329 | UIKit.framework/Headers/UINibLoading.h 330 | 331 | 332 | 333 | NSObject 334 | 335 | IBFrameworkSource 336 | UIKit.framework/Headers/UIResponder.h 337 | 338 | 339 | 340 | UIApplication 341 | UIResponder 342 | 343 | IBFrameworkSource 344 | UIKit.framework/Headers/UIApplication.h 345 | 346 | 347 | 348 | UIResponder 349 | NSObject 350 | 351 | 352 | 353 | UISearchBar 354 | UIView 355 | 356 | IBFrameworkSource 357 | UIKit.framework/Headers/UISearchBar.h 358 | 359 | 360 | 361 | UISearchDisplayController 362 | NSObject 363 | 364 | IBFrameworkSource 365 | UIKit.framework/Headers/UISearchDisplayController.h 366 | 367 | 368 | 369 | UIView 370 | 371 | IBFrameworkSource 372 | UIKit.framework/Headers/UITextField.h 373 | 374 | 375 | 376 | UIView 377 | UIResponder 378 | 379 | IBFrameworkSource 380 | UIKit.framework/Headers/UIView.h 381 | 382 | 383 | 384 | UIViewController 385 | 386 | IBFrameworkSource 387 | UIKit.framework/Headers/UINavigationController.h 388 | 389 | 390 | 391 | UIViewController 392 | 393 | IBFrameworkSource 394 | UIKit.framework/Headers/UIPopoverController.h 395 | 396 | 397 | 398 | UIViewController 399 | 400 | IBFrameworkSource 401 | UIKit.framework/Headers/UISplitViewController.h 402 | 403 | 404 | 405 | UIViewController 406 | 407 | IBFrameworkSource 408 | UIKit.framework/Headers/UITabBarController.h 409 | 410 | 411 | 412 | UIViewController 413 | UIResponder 414 | 415 | IBFrameworkSource 416 | UIKit.framework/Headers/UIViewController.h 417 | 418 | 419 | 420 | UIWindow 421 | UIView 422 | 423 | IBFrameworkSource 424 | UIKit.framework/Headers/UIWindow.h 425 | 426 | 427 | 428 | 429 | 0 430 | IBCocoaTouchFramework 431 | 432 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 433 | 434 | 435 | 436 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 437 | 438 | 439 | YES 440 | TPMultiLayoutViewControllerTest.xcodeproj 441 | 3 442 | 112 443 | 444 | 445 | -------------------------------------------------------------------------------- /TPMultiLayoutViewControllerTest/en.lproj/TPMultiLayoutViewControllerTestViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 11A511 6 | 1617 7 | 1138 8 | 566.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 534 12 | 13 | 14 | YES 15 | IBUITextField 16 | IBUISlider 17 | IBUIButton 18 | IBUIView 19 | IBUILabel 20 | IBProxyObject 21 | 22 | 23 | YES 24 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 25 | 26 | 27 | YES 28 | 29 | YES 30 | 31 | 32 | 33 | 34 | YES 35 | 36 | IBFilesOwner 37 | IBCocoaTouchFramework 38 | 39 | 40 | IBFirstResponder 41 | IBCocoaTouchFramework 42 | 43 | 44 | 45 | 274 46 | 47 | YES 48 | 49 | 50 | 292 51 | {{29, 20}, {57, 21}} 52 | 53 | 54 | 55 | _NS:311 56 | NO 57 | YES 58 | 7 59 | NO 60 | IBCocoaTouchFramework 61 | Label 1 62 | 63 | Helvetica 64 | 17 65 | 16 66 | 67 | 68 | 1 69 | MCAwIDAAA 70 | 71 | 72 | 1 73 | 10 74 | 75 | 76 | 77 | 292 78 | {{102, 15}, {186, 31}} 79 | 80 | 81 | 82 | _NS:294 83 | NO 84 | YES 85 | IBCocoaTouchFramework 86 | 0 87 | Text 1 88 | 3 89 | 90 | 3 91 | MAA 92 | 93 | 2 94 | 95 | 96 | YES 97 | 17 98 | 99 | IBCocoaTouchFramework 100 | 101 | 102 | 103 | 104 | 292 105 | {{29, 59}, {57, 21}} 106 | 107 | 108 | 109 | _NS:311 110 | NO 111 | YES 112 | 7 113 | NO 114 | IBCocoaTouchFramework 115 | Label 2 116 | 117 | 118 | 119 | 1 120 | 10 121 | 122 | 123 | 124 | 292 125 | {{102, 54}, {186, 31}} 126 | 127 | 128 | 129 | _NS:294 130 | NO 131 | YES 132 | IBCocoaTouchFramework 133 | 0 134 | Text 2 135 | 3 136 | 137 | 3 138 | MAA 139 | 140 | 141 | YES 142 | 17 143 | 144 | IBCocoaTouchFramework 145 | 146 | 147 | 148 | 149 | 292 150 | {{29, 167}, {107, 115}} 151 | 152 | 153 | 154 | _NS:222 155 | NO 156 | IBCocoaTouchFramework 157 | 0 158 | 0 159 | 160 | Helvetica-Bold 161 | 15 162 | 16 163 | 164 | 1 165 | A 166 | 167 | 3 168 | MQA 169 | 170 | 171 | 1 172 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 173 | 174 | 175 | 3 176 | MC41AA 177 | 178 | 179 | 180 | 181 | 292 182 | {{181, 167}, {107, 115}} 183 | 184 | 185 | 186 | _NS:222 187 | NO 188 | IBCocoaTouchFramework 189 | 0 190 | 0 191 | 192 | 1 193 | B 194 | 195 | 196 | 1 197 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 198 | 199 | 200 | 201 | 202 | 203 | 292 204 | {{42, 395}, {236, 23}} 205 | 206 | 207 | 208 | _NS:605 209 | NO 210 | IBCocoaTouchFramework 211 | 0 212 | 0 213 | 0.5 214 | 215 | 216 | 217 | 292 218 | {{44, 350}, {232, 21}} 219 | 220 | 221 | 222 | _NS:311 223 | NO 224 | YES 225 | 7 226 | NO 227 | IBCocoaTouchFramework 228 | Label 229 | 230 | 231 | 1 232 | 10 233 | 1 234 | 235 | 236 | {{0, 20}, {320, 460}} 237 | 238 | 239 | 240 | 241 | 3 242 | MC43NQA 243 | 244 | 245 | NO 246 | 247 | IBCocoaTouchFramework 248 | 249 | 250 | 251 | 274 252 | 253 | YES 254 | 255 | 256 | 292 257 | {{23, 27}, {57, 21}} 258 | 259 | 260 | 261 | _NS:311 262 | NO 263 | YES 264 | 7 265 | NO 266 | IBCocoaTouchFramework 267 | Label 1 268 | 269 | 270 | 271 | 1 272 | 10 273 | 274 | 275 | 276 | 292 277 | {{89, 20}, {359, 31}} 278 | 279 | 280 | 281 | _NS:294 282 | NO 283 | YES 284 | IBCocoaTouchFramework 285 | 0 286 | Text 1 287 | 3 288 | 289 | 3 290 | MAA 291 | 292 | 293 | YES 294 | 17 295 | 296 | IBCocoaTouchFramework 297 | 298 | 299 | 300 | 301 | 292 302 | {{23, 66}, {57, 21}} 303 | 304 | 305 | 306 | _NS:311 307 | NO 308 | YES 309 | 7 310 | NO 311 | IBCocoaTouchFramework 312 | Label 2 313 | 314 | 315 | 316 | 1 317 | 10 318 | 319 | 320 | 321 | 292 322 | {{89, 59}, {359, 31}} 323 | 324 | 325 | 326 | _NS:294 327 | NO 328 | YES 329 | IBCocoaTouchFramework 330 | 0 331 | Text 2 332 | 3 333 | 334 | 3 335 | MAA 336 | 337 | 338 | YES 339 | 17 340 | 341 | IBCocoaTouchFramework 342 | 343 | 344 | 345 | 346 | 292 347 | {{20, 121}, {180, 70}} 348 | 349 | 350 | 351 | _NS:222 352 | NO 353 | IBCocoaTouchFramework 354 | 0 355 | 0 356 | 357 | 1 358 | A 359 | 360 | 361 | 1 362 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 363 | 364 | 365 | 366 | 367 | 368 | 292 369 | {{20, 209}, {180, 71}} 370 | 371 | 372 | 373 | _NS:222 374 | NO 375 | IBCocoaTouchFramework 376 | 0 377 | 0 378 | 379 | 1 380 | B 381 | 382 | 383 | 1 384 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 385 | 386 | 387 | 388 | 389 | 390 | 292 391 | {{226, 201}, {236, 23}} 392 | 393 | 394 | 395 | _NS:605 396 | NO 397 | IBCocoaTouchFramework 398 | 0 399 | 0 400 | 0.5 401 | 402 | 403 | 404 | 292 405 | {{228, 150}, {232, 21}} 406 | 407 | 408 | 409 | _NS:311 410 | NO 411 | YES 412 | 7 413 | NO 414 | IBCocoaTouchFramework 415 | Label 416 | 417 | 418 | 1 419 | 10 420 | 1 421 | 422 | 423 | {{0, 20}, {480, 300}} 424 | 425 | 426 | 427 | 428 | 3 429 | MC43NQA 430 | 431 | 432 | NO 433 | 434 | 435 | 3 436 | 3 437 | 438 | IBCocoaTouchFramework 439 | 440 | 441 | 442 | 443 | YES 444 | 445 | 446 | view 447 | 448 | 449 | 450 | 7 451 | 452 | 453 | 454 | portraitView 455 | 456 | 457 | 458 | 17 459 | 460 | 461 | 462 | landscapeView 463 | 464 | 465 | 466 | 18 467 | 468 | 469 | 470 | sliderLabel 471 | 472 | 473 | 474 | 19 475 | 476 | 477 | 478 | updateSliderLabel: 479 | 480 | 481 | 13 482 | 483 | 20 484 | 485 | 486 | 487 | updateSliderLabel: 488 | 489 | 490 | 13 491 | 492 | 29 493 | 494 | 495 | 496 | 497 | YES 498 | 499 | 0 500 | 501 | 502 | 503 | 504 | 505 | -1 506 | 507 | 508 | File's Owner 509 | 510 | 511 | -2 512 | 513 | 514 | 515 | 516 | 6 517 | 518 | 519 | YES 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 8 533 | 534 | 535 | YES 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 9 549 | 550 | 551 | 552 | 553 | 10 554 | 555 | 556 | 557 | 558 | 11 559 | 560 | 561 | 562 | 563 | 12 564 | 565 | 566 | 567 | 568 | 13 569 | 570 | 571 | 572 | 573 | 14 574 | 575 | 576 | 577 | 578 | 15 579 | 580 | 581 | 582 | 583 | 16 584 | 585 | 586 | 587 | 588 | 21 589 | 590 | 591 | 592 | 593 | 22 594 | 595 | 596 | 597 | 598 | 23 599 | 600 | 601 | 602 | 603 | 24 604 | 605 | 606 | 607 | 608 | 25 609 | 610 | 611 | 612 | 613 | 26 614 | 615 | 616 | 617 | 618 | 27 619 | 620 | 621 | 622 | 623 | 28 624 | 625 | 626 | 627 | 628 | 629 | 630 | YES 631 | 632 | YES 633 | -1.CustomClassName 634 | -1.IBPluginDependency 635 | -2.CustomClassName 636 | -2.IBPluginDependency 637 | 10.IBPluginDependency 638 | 11.IBPluginDependency 639 | 12.IBPluginDependency 640 | 13.IBPluginDependency 641 | 14.IBPluginDependency 642 | 15.IBPluginDependency 643 | 16.IBPluginDependency 644 | 21.IBPluginDependency 645 | 22.IBPluginDependency 646 | 23.IBPluginDependency 647 | 24.IBPluginDependency 648 | 25.IBPluginDependency 649 | 26.IBPluginDependency 650 | 27.IBPluginDependency 651 | 28.IBPluginDependency 652 | 6.IBPluginDependency 653 | 8.IBPluginDependency 654 | 9.IBPluginDependency 655 | 656 | 657 | YES 658 | TPMultiLayoutViewControllerTestViewController 659 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 660 | UIResponder 661 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 662 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 663 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 664 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 665 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 666 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 667 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 668 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 669 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 670 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 671 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 672 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 673 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 674 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 675 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 676 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 677 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 678 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 679 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 680 | 681 | 682 | 683 | YES 684 | 685 | 686 | 687 | 688 | 689 | YES 690 | 691 | 692 | 693 | 694 | 29 695 | 696 | 697 | 698 | YES 699 | 700 | TPMultiLayoutViewController 701 | UIViewController 702 | 703 | YES 704 | 705 | YES 706 | landscapeView 707 | portraitView 708 | 709 | 710 | YES 711 | UIView 712 | UIView 713 | 714 | 715 | 716 | YES 717 | 718 | YES 719 | landscapeView 720 | portraitView 721 | 722 | 723 | YES 724 | 725 | landscapeView 726 | UIView 727 | 728 | 729 | portraitView 730 | UIView 731 | 732 | 733 | 734 | 735 | IBProjectSource 736 | ./Classes/TPMultiLayoutViewController.h 737 | 738 | 739 | 740 | TPMultiLayoutViewControllerTestViewController 741 | TPMultiLayoutViewController 742 | 743 | updateSliderLabel: 744 | id 745 | 746 | 747 | updateSliderLabel: 748 | 749 | updateSliderLabel: 750 | id 751 | 752 | 753 | 754 | sliderLabel 755 | UILabel 756 | 757 | 758 | sliderLabel 759 | 760 | sliderLabel 761 | UILabel 762 | 763 | 764 | 765 | IBProjectSource 766 | ./Classes/TPMultiLayoutViewControllerTestViewController.h 767 | 768 | 769 | 770 | 771 | 0 772 | IBCocoaTouchFramework 773 | 774 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 775 | 776 | 777 | YES 778 | 3 779 | 534 780 | 781 | 782 | -------------------------------------------------------------------------------- /TPMultiLayoutViewControllerTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TPMultiLayoutViewControllerTest 4 | // 5 | // Created by Michael Tyson on 14/08/2011. 6 | // Copyright 2011 A Tasty Pixel. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | --------------------------------------------------------------------------------