Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Addressed issue 69 on mattgemmell/master #73

Open
wants to merge 1 commit into from

6 participants

@ArtSabintsev

The fix adds iOS 6 compatibility.

@wedkarz wedkarz commented on the diff
Classes/MGSplitViewController.m
@@ -519,6 +519,7 @@ - (void)viewDidAppear:(BOOL)animated
[self.masterViewController viewDidAppear:animated];
}
[self.detailViewController viewDidAppear:animated];
+ [self layoutSubviews];
}
@wedkarz
wedkarz added a note

Isn't it just temporal fix? layout subviews should be called in willAppear, because still bad layout is flashing firstly.
What might be the cause of different behaviour in iOS6? I noticed that problem occures only while building project using Xcode 4.5 (or rather iOS SDK 6.0). If you build using old one (i.e. 4.3.3) it still works fine, even if iOS 6 device.

@sam899
sam899 added a note

@ArtSabintsev , @wedkarz - I just submitted a pull request that doesn't have the flashing problem on load for iOS 6 - Could you see if it has a better result for you?

Its working from navigation controller now. Before it was not showing in landscape mode. the master part was going blank.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jackbellis

When i use your code, Art(?) it rotates properly. When I use Matt's it does not. Can anyone explain the differences? I diff-ed all the classes and only saw the one line about the layout and I don't spot what the effect is when i apply that change to Matt's. Thanks

@ArtSabintsev

Instead of adding a subview, I reset the window's rootViewController (ArtSabintsev@a63c963). I called layoutSubviews later on, to re-draw/orient the view on rotation.

@jackbellis

Arggg... I had forgotten that the diff also picked that up, so I didn't try it in my experimenting. Thanks very much.

@ArtSabintsev

My pleasure!

@TrungVu37

could you fix MGSplitView in storyboard IOS > 5 plz?

@ArtSabintsev

No, I will not be doing that, as iOS 7 has ~86% market share and iOS 6 has ~12% marketshare, which leaves iOS 1-4 with 2% market share. https://mixpanel.com/trends/#report/ios_7

There is no reason to support iOS 5 or iOS 6 at this point in time.

@ArtSabintsev ArtSabintsev reopened this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 20, 2012
  1. @ArtSabintsev
This page is out of date. Refresh to see the latest.
View
BIN  .DS_Store
Binary file not shown
View
2  Classes/MGSplitViewAppDelegate.m
@@ -20,7 +20,7 @@ @implementation MGSplitViewAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Add the split view controller's view to the window and display.
- [window addSubview:splitViewController.view];
+ [window setRootViewController:splitViewController];
[window makeKeyAndVisible];
[rootViewController performSelector:@selector(selectFirstRow) withObject:nil afterDelay:0];
View
3  Classes/MGSplitViewController.m
@@ -507,7 +507,7 @@ - (void)viewWillAppear:(BOOL)animated
[self.detailViewController viewWillAppear:animated];
_reconfigurePopup = YES;
- [self layoutSubviews];
+
}
@@ -519,6 +519,7 @@ - (void)viewDidAppear:(BOOL)animated
[self.masterViewController viewDidAppear:animated];
}
[self.detailViewController viewDidAppear:animated];
+ [self layoutSubviews];
}
@wedkarz
wedkarz added a note

Isn't it just temporal fix? layout subviews should be called in willAppear, because still bad layout is flashing firstly.
What might be the cause of different behaviour in iOS6? I noticed that problem occures only while building project using Xcode 4.5 (or rather iOS SDK 6.0). If you build using old one (i.e. 4.3.3) it still works fine, even if iOS 6 device.

@sam899
sam899 added a note

@ArtSabintsev , @wedkarz - I just submitted a pull request that doesn't have the flashing problem on load for iOS 6 - Could you see if it has a better result for you?

Its working from navigation controller now. Before it was not showing in landscape mode. the master part was going blank.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
View
5 MGSplitView-Info.plist
@@ -33,5 +33,10 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
</dict>
</plist>
View
3  MGSplitView.xcodeproj/project.pbxproj
@@ -176,6 +176,7 @@
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MGSplitView" */;
compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
@@ -234,6 +235,7 @@
GCC_PREFIX_HEADER = MGSplitView_Prefix.pch;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "MGSplitView-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = MGSplitView;
};
name = Debug;
@@ -247,6 +249,7 @@
GCC_PREFIX_HEADER = MGSplitView_Prefix.pch;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "MGSplitView-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = MGSplitView;
VALIDATE_PRODUCT = YES;
};
View
7 MGSplitView.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:MGSplitView.xcodeproj">
+ </FileRef>
+</Workspace>
View
BIN  ...codeproj/project.xcworkspace/xcuserdata/Arthur.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
View
86 MGSplitView.xcodeproj/xcuserdata/Arthur.xcuserdatad/xcschemes/MGSplitView.xcscheme
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0450"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
+ BuildableName = "MGSplitView.app"
+ BlueprintName = "MGSplitView"
+ ReferencedContainer = "container:MGSplitView.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
+ BuildableName = "MGSplitView.app"
+ BlueprintName = "MGSplitView"
+ ReferencedContainer = "container:MGSplitView.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
+ BuildableName = "MGSplitView.app"
+ BlueprintName = "MGSplitView"
+ ReferencedContainer = "container:MGSplitView.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
+ BuildableName = "MGSplitView.app"
+ BlueprintName = "MGSplitView"
+ ReferencedContainer = "container:MGSplitView.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
View
22 MGSplitView.xcodeproj/xcuserdata/Arthur.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SchemeUserState</key>
+ <dict>
+ <key>MGSplitView.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>1D6058900D05DD3D006BFB54</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
Something went wrong with that request. Please try again.