The detail view of a UISplitViewController takes full screen only on iOS8 - ios

My UISplitViewController was functioning properly until I compiled the project with the new SDK (iOS 8.0). At some point (when the (void)viewDidAppear:(BOOL)animated of the detail view controller is called) the detail view maximizes to the full screen, covering the master view.
I managed to fix it by using the new displayMode property of the UISplitViewController:
[self.splitViewController setPreferredDisplayMode:UISplitViewControllerDisplayModeAllVisible];
However this property is supported only in iOS8 and now I cannot build for iOS7. Is my only choice now is to download the old SDK?

It sounds like your app was running okay on iOS 7.1, so (happily) you only need to execute that code in versions of iOS that do support it. So what about:
if ([self.splitViewController respondsToSelector:#selector(setPreferredDisplayMode:)]) {
[self.splitViewController setPreferredDisplayMode:UISplitViewControllerDisplayModeAllVisible];
}
Compile with the new SDKs, and be able to run in old and new iOS. You then just need to set your build Deployment Targets appropriately.
Hope this helps.

Related

Remove storyboard view controller iOS at build time

The fact is that I have a View Controller in my storyboard that is using StackViews. Now, I'm trying to make the application iOS 7 compatible but I don't want to remove that view controller. Is there a way to compile the project without that view controller? I tried to keep the build target of the storyboard to 9 but i would prefer if there is a way to hide that view controller at build time working with iOS 7 on the storyboard
Stack View came with iOS9 and you can't tell the Stack View to disappear depending on the running iOS. It's not possible to build the Storyboard depending on the iOS either. But it seems to be possible to select different storyboards depending on the used iOS. See this link. The cody is ojective-c, but it seems not that hard to transfer the logic.
You can either remove the Stack View or, what I'd suggest, build your App for iOS9, since some survey I've recently read, tells that up to 90% of all Apple Users upgrade to the newest iOS within a week. Your 3rd possibility is to build different storyboards depending on the iOS.
Edit: You may want to check out the OAStackView. Which implements most of the features from UIStackView and supports iOS 7+.

Window's root view controller is not Split view controller

I am trying to modify my existing app to use a split view controller. I've followed the sample master/detail project structure by adding a split view controller into my storyboard, made it the initial view controller and everything seemed to be working fine, until I tried to run the app in an iOS 7 simulator. All of a sudden when I hit my breakpoint in application: didFinishLaunchingWithOptions self.window.rootViewController is now the type of my master view controller, not the split view controller itself.
I thought maybe then I just need to get the split view controller off of the root view itself and tried rootViewController.splitViewController but that is nil. I must have missed some set up step in enabling this split view controller, but I have no idea what it was.
It is because UISplitViewController isn't supported in iPhone in iOS7, only in iPad.
If you run your code in iPad iOS7 you will see your UISplitViewController.
Only in iOS8 Apple added support for iPhone as well.
So this ended up being a pretty obscure issue. It seemed to be caused by the way that the iOS 8 SDK and Xcode 6 handle storyboards and size classes. I intend to file a bug report with apple but the repro steps to get this to present are simple:
Create a new master/detail application
Set deployment target to below 8.0 (7/7.1 works)
Change application type from "Universal" to "iPad"
You have to comment out this line from the generated app delegate, it will crash in an iOS 7 target:
navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem;
Run on iPad simulator for iOS 7.1
The fix to this issue is to disable size classes on the storyboard. I theorize that the way that Xcode 6 and the iOS 8 SDK are handling size classes for iPad versus universal app builds causes this to not work on iOS 7 targets, but turning off size classes fixes the issue.

unable to embed Navigation Controller from storyboard in iOS

![enter image description here][1]How to embed in Navigation Controller as I am having two View Controllers with one of them as RootViewController and when I go to editor--->Embed-in--->no options are usable/Selectable !! Please suggest me the reason as I have used Navigation Controller earlier in previous sample app and it was working fine .
Please help on this!! Thanks in advance
Your screen shot shows a nib file, not a storyboard. You need to create a storyboard and then you will be able to embed your view controller.
You will also need to change your project settings to require iOS 6 as a minimum Upgraded app to iOS 7 - error "Auto Layout on iOS Versions prior to 6.0" (but want iOS 7 not older)
Also make sure you change your project to refer to your main storyboard rather than an xib How to convert a NIB-based project to a Storyboard-based?

Split View based Ipad App : View Changed from v5.0 to v.51

I m creating a Split view based application for Ipad. I have used the following code in my app to get split view in my app(http://blog.corywiles.com/creating-a-universal-ios-app-tutorial). While i was checking out, the code seems to show the result i expected in Ipad v5.0 , like a drop down list. But in Ipad v5.1 the popover view changed for the same code.
How can i get the same popover view ,which i got in v5.0 Ipad ..?
Ipad 5.0 Screenshot : http://postimage.org/image/bre31nai9/
Ipad 5.1 Screenshot : http://postimage.org/image/7waoz2rch/
This is a change Apple introduced with the iOS 5.1 SDK. To get the old behavior, either target iOS 5.0 SDK or (preferably), use MGSplitViewController, which offers similar functionality to the old UISplitViewController.
If you are still looking for a way to have iOS 5.0 style popover with the split view, I just spent the last couple of hours looking and came up with a solution that puts the "over" back in "popover". its here if you need it: splitview poperver issues between ios5.0 and ios5.1
be well.

MonoTouch UISplitViewController - Device and Simulator different

Are there any known issues with UISplitViewController in MonoTouch? I am using MonoDevelop 2.8.8.4, MonoTouch 5.2.10 and xCode 4.3.2 (4E2002)
I have a UISplitViewController. When I go to portrait I display a button which the user can click to view the 'master' view in a popup controller. On the simulator it works exactly as expected - the master is displayed in a popupviewcontroller.
However, on the device (running iOS5.1), the master view will get pushed in from the side (like it would on a UINavigationController.PushController()
and this from iOS 5.1 Release Notes:
In 5.1 the UISplitViewController class adopts the sliding presentation
style when presenting the left view (previously only seen in Mail).
This style is used when presentation is initiated either by the
existing bar button item provided by the delegate methods or by a
swipe gesture within the right view. No additional API adoption is
required to obtain this behavior, and all existing API, including that
of the UIPopoverController instance provided by the delegate, will
continue to work as before. If the gesture cannot be supported in your
app, set the presentsWithGesture property of your split view
controller to NO to disable the gesture. However, disabling the
gesture is discouraged because its use preserves a consistent user
experience across all applications.
Are there any known issues with UISplitViewController in Monotouch?
Nothing specific to MonoTouch and UISplitViewController - but like you found out the later has changed quite a bit internally for iOS 5.1 and this can show up in applications.
I am using MonoDevelop 2.8.8.4, Monotouch 5.2.10 and xCode 4.3.2 (4E2002)
What's even more important is which version of the iOS simulator are you using ? i.e. iOS 5.0 or iOS 5.1 ?
In any case be aware that different version of iOS calls their selectors at different times. This can lead to cases where the same code will behave differently on different iOS versions.
One known case for this is about UISplitViewController. You can read about it (why and how it can occurs) and how to fix this properly to work identically across both versions of iOS.
Disclaimer: link to my own blog
Yes this is the "new Feature".
There is no Popover(UISplitViewController MasterView) anymore.
I tried to change but nothing works. I asked the Monotouch Support for help. But the also dont know anything.
Here is a Link to my Question maybe this can answer your question better;)
UISplitViewController problems with IOS 5.1

Resources