title: SwiftUI Make a list that shows only a certain amount of rows
body: <p>I have recently started messing around with SwiftUI and so far it is great. I have however ecnountered a problem that I can't seem to find an answer to.</p>
  <p>I am trying to create this design:</p>
  <p><a href="https://i.stack.imgur.com/FFcWb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FFcWb.png" alt="What I want to create" /></a></p>
  <p>As you can see here is a tableview (a list) which rows have a smaller tableview (a list) inside them. The task was pretty simple while using IB, but with swiftUI I can't seem to find a way to limit the number of rows to only the amount I need or to manually set the lists height based on the number of rows (keep in mind those rows can also be variable in height).</p>
  <p>My code so far only consist of creating the List and adding 2 test rows:</p>
  <pre><code>List {
      OrderItemRow()
      OrderItemRow()
  }
  </code></pre>
  <p>But as you can see SwiftUI automatically stretches the List to fill all the available space. The effect:
  <a href="https://i.stack.imgur.com/O8zd9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O8zd9.png" alt="enter image description here" /></a></p>