skip to Main Content

Hiii !
it’s my second app on Xcode.

I noticed that my navigation item is not a button but a "drop down" and I don’t know why

How can I change it ? Image: navigation item

2

Answers


  1. What you’re dealing with is that your storyboard or screen is as a sheet.

    Segue set as Page Sheet

    Changing this to full screen will give it a bar, but you may need to embed the scene into a navigation control to create a bar. You can do that via Editor -> Embed In -> Navigation Controller.

    Segue set to full screen

    Embedded into Navigation Controller
    The navigation controller color is set to black to be noticeable.

    Login or Signup to reply.
  2. So from the comment, I will answer detail about your problem for futher reader and yourself.

    As Swift there is two types of tranfering to from view controller to another view controller

    First one is using presentViewController which is presents a view controller modally. Just like from your image and we usually use it for task you don’t want user to navigate from so just two methods cancel or continue. Example: Sign In, Sign Up, …

    Second one is using pushViewController which will have a Back button just like you want in the navigation bar. And in this case you can control your own controller, callback, … Remember to define what is root view controller by using Embed in Navigation controller if you use storyboard or define by code by using

    UIApplication.shared.windows.first?.rootViewController = vc // your view controller
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search