Master Detail Controller is always presented modally since iOS 13 - ios

I have a login screen that pushes to a master-detail VC on successful auth.
However the screen following log in is always presented modally, this behavior started since iOS 13 (prior to that, login screen pushed to the initial VC, and another master VC linked VC had the menu)
To demonstrate, I took the final code from RW's master-detail view the tutorial, added a view with a button, linked button's action to master VC with a push segue. After this, even in the storyboard, you can see that the Master VC is presented modally. not pushed.
Attaching source code of modified code which shows what I want to demonstrate this
And a screenshot as well -

From the screen shot you've posted I can see that you don't have a navigation controller embedded to your initial view controller. So when you do a segue from your initial view controller via storyboard it'll present the view controller and presentation will not be fullscreen by default (in iOS 13).
You can change this setting via storyboard as well as in your view controller
In storyboard select your view controller and refer to the screenshot
For more detail refer to this question for full screen presentation

Try to change the kind to Present Modally and after that change the Presentation to Full Screen.

Programatically while presenting , add this code
if #available(iOS 13.0, *) {
nextViewController.modalPresentationStyle = .fullScreen
}

Related

How to push a view controller programmatically from Detail view controller

My app has a split view controller as root with master detail view. I'm doing this programmatically without using storyboards. I want to push a new view controller from a button in detail view and close the split view. When I tried, it opened inside the detail view. self.navigationController?.pushViewController(mainView, animated: true)
But I want it to open full screen and have a back button to goto the split view. How can I do that?
I think you need either present it Modally or change the rootViewController in corresponding to your action.

Navigation Controller segue is presented modally

I tried to build a simple segue. Therefor I embedded a Navigation Controller and set it as the initial View Controller. I then created the segue (kind: show) to a different ViewController.
Storyboard
Even the storyboard looks right and I can run the app without any Errors or Warnings.
But when I open the app in the simulator and press on the button to switch screens the new view pops up like a modal presentation.
Simulator
None of this is done programmatically. To solve this issue I tried different segue kinds after that I rebuild the Navigation Controller and segue entirely but it changed nothing.
I just created two view controllers, embedded a nav controller and then connected a button in the first view controller to the second. In the simulator, pressing the button showed the second view controller with a nav bar on top. Try deleting the current segue and nav controller, and then embed in the nav controller and create the segue again.
Storyboard
First page
Second page

Navigation Controller Header is not showing

So, here I basically have this layout
but when I build successfully I am not able to see the title of the navigation controller.
What can I do?
This is what you want to emulate:
Set the UITabBarController as is Initial View Controller
add a relationship to each scene, whether it is a UINavigationController or not
If a scene is a UINavigationController, it will behave like any root navigation controller, with its own view stack, back button, an so forth.
Running the app above, then tapping on Item 2 will present this navigation controller:
If you cannot make the UITabBarController the initial View Controller at launch, you can make it become root later on using this technique:
let newViewController = self.storyboard?.instantiateViewControllerWithIdentifier("id")
as? UIViewController
self.view.window?.rootViewController = newViewController
This will present the architecture above, albeit without animation (nor any way to navigate back). Perfect for onboarding or login screens.
Tested on Xcode 7+, iOS 9+
Make your TabBar Controller the initial view, And make sure to remove the navigation controller that's linked to it, Then it should work fine.

Programming Transition Loses Navigation Bar

I'm having an issue with my main.storyboard file. I changed the settings of my app so that the start screen is the main.storyboard file, rather than LaunchScreen.xib. The initial ViewController is the NavigationController, and the second is my SplashScreeViewController. (I created my own splash screen in the storyboard so that I could change it with additional code.) I use a line of code in my splash screen to later transition to the second view controller. Here it is:
var controller:UIViewController = self.storyboard?.instantiateViewControllerWithIdentifier("Second") as! ViewController
controller.modalTransitionStyle = .CrossDissolve
self.presentViewController(controller, animated: true, completion: nil)
For some reason, when I transition to that second ViewController, the navigation bar that should be at the top (of the second ViewController) isn't there, opposite of what was shown in the main.storyboard file. I tried to add an invisible, disabled button to the splash screen as to add a connection between the two view controllers, and therefore adding a navigation bar to the second, but when the splash transitions on its own, no navigation bar appears on the second.
Is there a way I could have a navigation bar on my second view controller without dragging one in, nor programming it in? I would like to use the one Xcode provides when you create a new connection between controllers.
Thanks in advance to all who reply.
*(I apologize for the lack of pictures to help describe my problem. I don't have enough 'reputation' to do so.)
You need to embed your Second view controller on a Navigation Controller, and then instantiate that navigation controller instead.
This might solve the problem - It looks like you are presenting a modal view controller when you probably want to be pushing your view controller from your initial navigation controller with pushViewController

Modal view gets moved to the back when autorotating with MGSplitViewController in iOS 5.x

I've successfully implemented MGSplitViewController in my application and it seems to work pretty well but in iOS 5.x, it has this weird issue.
I start my app with its MGSplitViewController as the root view controller in Portrait.
Trigger my full screen modal view controller that gets displayed over top successfully.
Rotate device to Landscape and the view disappears but there's a piece of it still showing through the split view slider.
Has anyone seen this and/or fixed it? It works just fine in iOS 6.
If I rotate the view back or try to open other modal views, nothing happens. It's like that modal view is stuck behind.
Note: This is how I setup my MGSplitViewController: Known effort to update MGSplitViewController for iOS5 and Storyboards?
Ok well I figured out what the problem was.
I was presenting my modal views (and segues) from the tab Controller or the detail view controller and the modal views (and global modal segues) needed to be presented from the MGSplitViewController instead.
When I was using UISplitviewController, I had been able to present the modal views/segues from that controller but when I switched to MGSplitViewController, it was not represented in the storyboard so I tried setting global modal segues (such as login) to the tab bar controller which is the master controller. This seemed to cause the issue.
For modal views, I ended up presenting them from the MGSplitViewController and I had to remove the segue I had and simply present any modal view controllers I had previously segued directly from the MGSplitViewController instead.

Resources