title: TabbedView using SwiftUI in Xcode11Beta (11M336w)
body: <p>I am following along with the session from WWDC2019 here : </p>
  
  <p><a href="https://developer.apple.com/videos/play/wwdc2019/216/" rel="nofollow noreferrer">https://developer.apple.com/videos/play/wwdc2019/216/</a></p>
  
  <p>I have the following code working for creating a TabbedView using SwiftUI : </p>
  
  <p>//Section1 | ContentView (mine)---------------------------</p>
  
  <pre><code>import SwiftUI
  
  struct ContentView : View {
      var body: some View {
          NavigationView {
              TabbedView(selection: .constant(1)) {
                  PlaceForm().tabItemLabel(Text("Tab1")).tag(1)
                  FavoritesForm().tabItemLabel(Text("Tab2")).tag(2)
              }
          }
  
      }
  }
  
  #if DEBUG
  struct ContentView_Previews : PreviewProvider {
      static var previews: some View {
          ContentView()
      }
  }
  #endif
  </code></pre>
  
  <p>//--------------------------- 
  The above produces the following tabbed view : </p>
  
  <p><a href="https://i.stack.imgur.com/j6oWO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j6oWO.png" alt="Tabbed View without image"></a></p>
  
  <p>However, in the WWDC2019 session, the following code is used : </p>
  
  <p>//Section2 | ContentView (Apple's)---------------------------</p>
  
  <pre><code>import SwiftUI
  
  struct ContentView : View {
      var body: some View {
          NavigationView {
              TabbedView(selection: .constant(1)) {
                  PlaceForm().tabItemLabel {
                      Image(systemName: "square.and.pencil")
                      Text("Tab1")
                  }
                  FavoritesForm().tabItemLabel {
                      Image(systemName: "clock.fill")
                      Text("Tab2")
                  }
              }
          }
  
      }
  }
  
  #if DEBUG
  struct ContentView_Previews : PreviewProvider {
      static var previews: some View {
          ContentView()
      }
  }
  #endif
  </code></pre>
  
  <p>//---------------------------    </p>
  
  <p>However, on Xcode11Beta, this results in the following compiler error being thrown by Xcode11Beta</p>
  
  <pre><code>Cannot convert value of type 'TabbedView&lt;Int, 
  
  TupleView&lt;(_ModifiedContent&lt;PlaceForm, _TraitWritingModifier&lt;AnyView?&gt;&gt;, 
  
  _ModifiedContent&lt;FavoritesForm, _TraitWritingModifier&lt;AnyView?&gt;&gt;)&gt;&gt;' to 
  
  closure result type '_'
  </code></pre>
  
  <p>as seen in the following screenshots<a href="https://i.stack.imgur.com/FrbQH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FrbQH.png" alt="enter image description here"></a></p>
  
  <p>and</p>
  
  <p><a href="https://i.stack.imgur.com/zQCBC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zQCBC.png" alt="enter image description here"></a></p>
  
  <p>//---------------------------   </p>
  
  <p>What is the reason that the code demonstrated in the WWDC2019 slides don't result in the images showing up in the tabs of the tabbed view as should be expected if the information in the WWDC2019 presentation is correct?</p>
  
  <p>Also, with the code in section1, switching tabs to tab2 shows a blank view as described in the following question : </p>
  
  <p><a href="https://stackoverflow.com/questions/56485649/swiftui-tabbedview-only-shows-first-tabs-content">SwiftUI TabbedView only shows first tab&#39;s content</a></p>
  
  <p>Please note that the contents of PlaceForm and FavoritesForm are as reproduced below</p>
  
  <p>//Section3 | PlaceForm---------------------------</p>
  
  <pre><code>import SwiftUI
  
  struct PlaceForm : View {
      var body: some View {
          List {
              VStack {
                  MapView()
                      .edgesIgnoringSafeArea(.top)
                      .frame(height: 300)
  
                  CircleImage()
                      .offset(y: -130)
                      .padding(.bottom, -130)
                  VStack {
                      VStack {
                          Text("Turtle Rock")
                              .font(.title)
                              .color(.black)
                      }
                      HStack {
                          Text("Joshua Tree National Park")
                              .font(.subheadline)
                          Spacer()
                          Text("California")
                              .font(.subheadline)
                      }
                      }
                      .padding()
              }
          }.listStyle(.grouped)
  
      }
  }
  
  #if DEBUG
  struct PlaceForm_Previews : PreviewProvider {
      static var previews: some View {
          PlaceForm()
      }
  }
  #endif
  </code></pre>
  
  <p>//Section4 | FavoritesForm---------------------------</p>
  
  <pre><code>import SwiftUI
  
  struct FavoritesForm : View {
      var body: some View {
          List {
              VStack {
                  MapView()
                      .edgesIgnoringSafeArea(.top)
                      .frame(height: 300)
  
                  CircleImage()
                      .offset(y: -130)
                      .padding(.bottom, -130)
                  VStack {
                      VStack {
                          Text("Ninja Rock")
                              .font(.title)
                              .color(.black)
                      }
                      HStack {
                          Text("Joshua Tree National Park")
                              .font(.subheadline)
                          Spacer()
                          Text("California")
                              .font(.subheadline)
                      }
                      }
                      .padding()
              }
              }.listStyle(.grouped)
  
      }
  }
  
  #if DEBUG
  struct FavoritesForm_Previews : PreviewProvider {
      static var previews: some View {
          FavoritesForm()
      }
  }
  #endif
  </code></pre>