title: Array of dynamic structs containing views
body: <p>How do you create an array of structs which all might have a different partial userinterface?
  The idea is, that I can have a dynamic list of blocks, and whichever block is activated, the according UI (so the view of the block's content attribute) is displayed.</p>
  <p>So far I have the following struct:</p>
  <pre><code>struct Block&lt;Content: View&gt; {
      var name: String
      var symbol: String
  
      var content: () -&gt; Content
  
      init(name: String, symbol: String, @ViewBuilder content: @escaping () -&gt; Content) {
          self.name = name
          self.symbol = symbol
          self.content = content
      }
  }
  </code></pre>
  <p>I tried to initialize an array like so:</p>
  <pre><code>let blocks: [Block] = [
      Block(name: &quot;block 1&quot;, symbol: &quot;b1&quot;) {
         HStack{Text(&quot;t1&quot;) Button(&quot;b1&quot;){}}
      },
      Block(name: &quot;block 2&quot;, symbol: &quot;b2&quot;, content: Text(&quot;t1&quot;)),
      Block(name: &quot;block 3&quot;, symbol: &quot;b3&quot;, content: Text(&quot;t1&quot;)),
      // ...
  ]
  </code></pre>
  <p>This aproach gives me the following error:
  Cannot assign value of type '[Block]' to type '[Block]'</p>