title: UIKit: Adding text to NavigationBar
body: <p>I'm diving into UIKit and feel some misunderstanding after using SwiftUI. By following <a href="https://www.hackingwithswift.com/read/2" rel="nofollow noreferrer">course</a> from Paul Hudson there is some challenges in the end of the project. One of this it's try showing the player’s score in the navigation bar. I try to solve this case but closest solution that I found from Apple's documentation it's:</p>
  <pre><code>let scoreButton = UIBarButtonItem(title: NSLocalizedString(&quot;Score: \(score)&quot;, comment: &quot;&quot;),
                                          style: .done,
                                          target: self,
                                          action: nil)
  navigationItem.rightBarButtonItem = scoreButton
  </code></pre>
  <p>But I think adding <code>Button</code> instead of simple <code>Text</code> is unnecessary, I don't need button behavior. Trying to add <code>UITextView()</code> to <code>NavigationBar</code> from storyboard did't work out...</p>
  <p>Question: how to add text(better programmatically) to Navigation Bar? something like <code>.toolbarItem</code> with <code>ToolbarItemPlacement: .navigationBarTrailing</code> in SwiftUI. Is it possible or it's a UIKit restriction using only <code>rightBarButtonItem</code>?</p>
  <p><a href="https://i.stack.imgur.com/f85Hi.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f85Hi.jpg" alt="enter image description here" /></a></p>