1
votes

for the past one year I have not built an iOS app because I have to concentrate in Android development. and there are a lot of changes in iOS 13 development

I have some VCs in navigation controller like this enter image description here

when I use push segue from VC1 to VC2 and back to VC1, then it will make it like a cards like this. here is the code I use when the button in the first VC is clicked

@IBAction func createEventButtonDidPressed(_ sender: Any) {

    // do some actions first and then
    performSegue(withIdentifier: "chooseEventName", sender: nil)
}

enter image description here

I have tried to read this Presenting modal in iOS 13 fullscreen , so I make fullscreen modal segue like this

enter image description here

but it will make the navigation bar in VC2 (that blue vc) will not show.

I have tried to select to bar to be 'Translucent navigation bar' enter image description here

but when I run the app, I can't get that navigation bar in second VC, the navigation bar doesn't show when using fullscreen modal segue

I really need the behaviour exactly the same before iOS 13. like using push segue and the navigation bar still on top without look like a cards

how to do that ?

2

2 Answers

0
votes

Let's then refresh your mind in iOS a bit.

PUSH requires navigationController. This makes the new screen slides to the leading side. If there's no navigationController, then the new screen will be presented modally instead. We use POP in code if we want to make the new screen to be popped and user to go back to the previous screen.

PRESENT does not require navigationController. This makes the new screen slide up. We use DISMISS in code if we want to dismiss it. You can add a navigationController to the next screen if you need one.

Now what's new with iOS 13.0 when it comes to presenting screens? By default, the screens will now be presented as cards, not in fullscreen.

Back to your problem:

I really need the behaviour exactly the same before iOS 13. like using push segue and the navigation bar still on top without look like a cards

You will need to use PUSH not PRESENT. Tap on that segue again, and select SHOW (this is the push equivalent in Interface Builder). And also tap on that VC1 and click on Xcode's EDITOR menu, Embed In, and click NavigationController.

0
votes

If you embed VC2 into its own Navigation Controller it will display with the navigation bar. So your view should look like UINav->VC1->UINav->VC2

When presenting a view full screen and modal, all previous Navigation Controllers don’t form part of the new stack.