Search code examples
iosuinavigationbarright-to-leftuinavigationitemios11

Making Large Title Display on iOS 11 Right to Left


As of iOS 11, Apple has added Large Title Display Mode for UINavigationBar and UINavigationItem which makes an effect like this:

enter image description here

We could simply turn this effect on using the following Swift code:

navigationBar.prefersLargeTitles = true

My question is how we can make the large title right to left to be usable for Eastern right to left languages?

Thanks in advance.


Solution

  • I use this approach :

    override func viewDidLoad() {
        super.viewDidLoad()
    
        navigationController?.navigationBar.subviews[1].semanticContentAttribute = .forceRightToLeft
    
    }