title: SwifUI update the navigationBarItems title based on condition
body: <p>I like to update a navigationBarItems title based on certain condition, I am using below code.</p>
  <p>Here currentpage state is getting updated, but navigationBarItems title not getting updated.</p>
  <pre><code>@State private var currentPage = 0
  var pages: [MyPage]
  
  var body: some View {
      ZStack(alignment: .bottom) {
            //Here current page value is getting updated
         PageView(currentPage: $currentPage)
      }
      .navigationBarItems(trailing: Text(currentPage == pages.count ? &quot;Done&quot; : &quot;Skip&quot;))
  }
  </code></pre>