swiftuinavigationbaruistoryboardpreferslargetitles

how to get largeTitle on current vc, but small title on vc being pushed to?


I have a simple "more" screen where I want to have a largeTitle. I have several entries in a static table view which are leading to other view controllers. I want to have the large title in the "more" screen, but not in the screens pushed to. Either are all of the titles large or all small. How do I do it? I am using the storyboard.

enter image description here


Solution

  • On the detail vc set the following:

    self.navigationItem.largeTitleDisplayMode = .never
    

    If you access the navigationItem of the navigationController, it will change all detail vc, but if you access the navigationItem of the detailVC, it will only change the current title in the navigationBar.

    You cannot do that in Storyboard, because you cannot click on the navigationBar itself in the detail vc.

    More information available in a WWDC video from 2017.