title: Where should loop be used to generate dummy data for SwiftUI preview?
body: <p><code>preview</code> is a static function and it makes using instance variable inside it impossible.</p>
  <p>One way is to create data manually like the code below, it works but it does not scalable if say 1000 rows are needed.</p>
  <pre><code>static var data = [
      Item(id: UUID())
  ]
  </code></pre>
  <p>The question is, where is a good place to generate dummy data in a <code>for</code> loop? In this case how to generate a list of items for preview purposes?</p>
  <pre><code>struct MyListView: View {
      let items: [Item]
      
      var body: some View {
          List(items) { item in
              item.id
          }
      }
  }
  
  struct MyListView_Previews: PreviewProvider {
      // Works but not every elegant :(
      static var dummyItems = [
          Item(id: UUID())
      ]
  
      static var previews: some View {
          MyListView(items: dummyItems)
      }
  }
  </code></pre>