UISplitViewController in UITabbar - ios

I have an UISplitViewController in a TabbarController, it works fine until I left the SplitView in portrait mode and change in my other view to landscape and go back to my splitview tab.
After that my controller try to call willPresentViewController and this fails with
2012-11-08 10:08:27.047 app[77747:c07] *** Assertion failure in -[UIPopoverController _incrementSlideTransitionCount:],
/SourceCache/UIKit_Sim/UIKit-2372/UIPopoverController.m:510
I thought it happened because the splitview didnt rotate when I came back.
I tried this control https://github.com/grgcombs/IntelligentSplitViewController but it didnt work either.
I can resolve it a bit but I have the problem now that the master in landscape is always black when I rotate in the kind I described.

The whole "leave tab, rotate, come back to tab" can be a pain because inactive tabs don't get the rotation events.
In the past I have used two different ways to solve the issue:
Create a custom sub-class of the UITabBarController which forwarded rotation events to UIViewControllerseven if they were not the active tab.
Have the UIViewController which needs to know about rotations use the NSNotificationCenter and register for the event UIDeviceOrientationDidChangeNotification
Which one I used really depended on how many of my tabs needed to track that information. If 1 tab needs the info, #2 is probably the direction to head, but if 4 out of 5 need it, then #1 is probably the way to go.

Related

Weird UIViewController hidesBottomBarWhenPushed layout bug that only occurs the very first time a view controller is pushed

I'm really at a loss with this one, especially considering it has previously been working fine and I can't find anything in my commits that would have broken it.
I have a UITabBarController as the master view of a UISplitViewController. Each tab in the UITabBarController has its own UINavigationController that manages a stack of child VCs.
The issue is that any child VCs that have hidesBottomBarWhenPushed set to true results in a glitchy transition, but only the very first time any UINavigationController push occurs.
Here is a video of the transition bug
As you can see, it appears as if the safe area is collapsing on transition (and indeed, this does not occur on iPad or any other iPhone that lacks a bottom safeAreaInset. Yet, on the second (and all subsequent) push, it behaves perfectly fine.
The only thing I can think of is that I'm implementing the UISplitViewControllerDelegate methods to ensure Show Detail segues occur as a push rather than a modal when on the iPhone. However, the issue still happens with a regular push (bypassing the delegate methods altogether).
The various view controllers are all the standard base classes with no overridden layout behaviour, and I'm not implementing any custom transitions or transition coordinators.
Any thoughts on what the issue might be would be greatly appreciated.
So I managed to fix it. I was performing a modal segue before the UITabBarController was coming on screen. Apparently that messes up the layout, as I was able to confirm via a minimal replication. Changing the segue presentation type to "over full screen" rather than "default" stops the underlying UITabBarController from being removed from the view hierarchy and fixes the issue.
While that's six hours of my life I'll never get back I hope it helps someone in future.

iOS 10 - NavigationController, view not being hide completely on dismiss

I'm developing an iOS 10 app using NavigationController and Storyboards. I'm having a difficult time to figure out whats going on with a strange - as I'm calling it - bug:
When I navigate to a new ViewController, it show's nicely, but when the app unwind a segue, the top view controller doesn't go all the way to the right, instead, it left's about 50 points on screen, and then suddenly it goes away...
I'm putting a image that illustrates what I'm talking about...
PS: both ViewControllers uses UIImageView as background...
Thanks a lot!
Please share the code where you are setting the fame for the view(s). It could possibly be an offset that is being added. Though, you do mention that it does go away suddenly, so it could be something else.

Update to El Capitan and Xcode 7.1 gave me terrible default transitions

I just got this update and all of the sudden all of my segues have this terrible 5 second long transition. I turned off animation for the segues on my storyboard and it stopped the animation but it is still there for the unwind segues.
I created a test app to work on this and it is just 2 views in a navigation controller. and a single button to move from view a to b.
I tried creating a custom segue but that got rid of my navigation bar completely so all that does not help. I tried overriding the 'segueForUnwindingToViewController' in my navigationController class and that did absolutely nothing.
I am not sure what to do about this and I really need to get rid of these transitions...or even better I would like to customize them (especially the duration).
That's because you hit Slow Animations at some point. Under the debug menu in the simulator, uncheck Slow Animations, or just hit command-T.

SplitView’s displayModeButtonItem does not show a title on the iPad (iOS8)

I am trying to create a simple split view, Master/Detail, application on iOS8. The storyboard is something like the following:
SVC=SplitViewController
TBVC=TabBarViewController
TVC=TableViewController
SVC---(Master)→ TBVC → TVC -> ASplitViewMaster
|
+---(Detail) → ADetailViewRelatedToTheCurrentMasterView
Bascially, the user touches the “Items” tab, and a tableviewcontroller will appear that shows the kinds of items (i.e. Customers, Foods,etc.). The user touches “Customers”, I want to load a master that shows customers and shows the selected customer’s details in the Detail view. If the user touches a different item (i.e. Foods), then a different MasterView and its related details is loaded.
The project that I’ve created is about 95% towards a working model. It works properly on the iPhone. It works properly on the iPad in landscape mode, but the splitview’s displayModeButtonItem only shows a < without a title on the iPad in Portrait mode. I cannot figure out what I am doing wrong, so I hope that you can help me. I am sure that others may find this view architecture interesting, too, so hopefully this solution will help others in the future.
Here is the sample project on which I have been working…
https://4a1e8691fb88b7b41341-80de7026d6700afa799b216d7fcde2cf.ssl.cf2.rackcdn.com/MultipleMasterDetailViewsWTab-iOS8.zip
Anyway, I would appreciate your help to figure out what I am doing wrong.
Thanks for your time and assistance,
Mike
displayModeButtonItem() method handles the left UIBarButtonItem for you.
The UISplitViewController act differently between iPhones and iPad.
In your case -iPad in portrait mode- the master ViewController is presented as a popover, so you shouldn't have a back button nor a title on it, because you are not trying to go back, you are presenting a popover.
Since iOS 8 there is no UIPopover. The underlying UISplitViewController handles the master (primary) and detail (secondary) UIViewControllers and "vends" the displayModeButtonItem. Ideally, the title of that button should be the title of the top UIViewController of the primary viewController stack. It isn't. I've had some luck, when the master root controller is a UINavigationController, setting its title to match its topLevelController's title, but there are still cases where that technique doesn't seem to work.

iPad UISplitView initial state in portrait: how to display popover controller widget?

I'm working on an iPad app that uses a UISplitView. Inspired by http://blog.blackwhale.at/2010/04/your-first-ipad-split-view-application/, I display a button in my detail view when in portrait mode that shows the popover controller. This works great. However, the appropriate UISplitViewControllerDelegate message is only sent when the device rotates. So, when the app first loads (in portrait mode), my navigation button is not visible.
Is it possible to somehow convince the UISplitViewController to send that message on load or something, or do I need to re-implement my own popover logic to get things working?
Thanks,
-Patrick
We had the exact same issue and it turned out that this thread had the right clues. When comparing our app with the SplitView template, we noticed that the split template does exactly what was mentioned here: set the UISplitViewController as the root view controller in application:didFInishLaunchingWithOptions.
Out previous solution linked the split view controller in the XIB directly to the window. While this works it seems the split view has difficulties getting the startup orientation and the missing button occurs. When we removed the link in the XIB and created it in code in the app delegate, everything ran fine.
That's weird. Maybe you missed something. Take a look at the template based on a splitController. It works fine form very startup no matter in what mode the app was loaded.
did you make sure that your UISplitViewController's view is the only subview of your UIWindow, and that you added it inside the application:didFinishLaunchingWithOptions: method of your app delegate

Resources