title: SwiftUI: ViewBuilder unable to create a collection of Views based on array
body: <p>I am trying to build a simple <code>List</code> by using <code>SwiftUI</code>. However, I am not able to dynamically create the rows by using an array of data. This is the error message: <code>Cannot convert value of type '(Setlist) -&gt; SetlistRow' to expected argument type '(_) -&gt; _'</code></p>
  
  <p>I've tried at least the following syntaxes, but I always get the same error.</p>
  
  <ul>
  <li><code>List(setlists) { }</code></li>
  <li><code>List(setlists, rowContent: Setlist.init)</code></li>
  <li><code>ForEach(self.setlists) { setlist in }</code></li>
  </ul>
  
  <p>Here is my code:</p>
  
  <pre><code>struct Setlist {
      var name: String = "New setlist"
      var sets = [SongSet]()
  }
  
  struct SetlistManagerView : View {
  
      private var setlists: [Setlist] {
          // creates an array of dummy items
      }
  
      var body : some View {
  
          List {
              ForEach(setlists) {
                  SetlistRow(setlist: $0)
              }
          }
  
      }
  }
  
  struct SetlistRow : View {
  
      var setlist: Setlist
  
      var body : some View {
  
          let numberOfSongs = setlist.sets.map { $0.songs.count }.reduce(0, +)
  
          return NavigationView {
              NavigationButton (destination: SetListView(setlist: setlist)) {
                  // code for displaying the row
              }
          }
      }
  }
  
  </code></pre>