The only change, prefersLargetitles in the UINavigationBar API for iOS 11, is prefersLargetitles only for prefersLargetitles . check here
You can do this for your own applications with one small change: check the “Prefers big headers” box for the navigation bar in IB or, if you prefer to do this in code, using
navigationController?.navigationBar.prefersLargeTitles = true
edit
If you need to change the text attributes of a large header, you need to use the new largeTitleTextAttributes property on the UINavigationBar :
UINavigationBar.appearance().largeTitleTextAttributes = [ NSForegroundColorAttributeName: UIColor.white ]
Update for Swift 4.2:
Since NSForegroundColorAttributeName been renamed to NSAttributedString.Key.foregroundColor , use:
UINavigationBar.appearance().largeTitleTextAttributes = [ NSAttributedString.Key.foregroundColor: UIColor.black ]
Moin Shirazi Jun 07 '17 at 10:38 on 2017-06-07 10:38
source share