title: Generic struct from defined protocol
body: <p>I know this may sound basic to a lot of people, but my brain today is working at 2 cylinders and I cannot figure this out...</p>
  <p>I had this view working perfectly.</p>
  <pre><code>struct MyView: View {
  
    @ObservedObject private var myModel:MyModel
    
    init(myModel:MyModel) {
      self.myModel = myModel
    }
  </code></pre>
  <p>Now I have a second kind of model. I need to modify <code>MyView</code> to be generic.</p>
  <p>So I have started by creating a protocol because the variables and function calls of both models will be the same and assigned these protocols to both models.</p>
  <p>Now I need to modify the view to something like</p>
  <pre><code>struct MyView: View {
  
    @ObservedObject private var myModel:Any
    
    init(myModel:Any) {
      self.myModel = myModel
    }
  </code></pre>
  <p>But I am sure it is not the way to do that.</p>
  <p>or something like</p>
  <pre><code>struct MyView&lt;T&gt;: View {
  
    @ObservedObject private var myModel:T
    
    init(myModel:T) {
      self.myModel = myModel
    }
  </code></pre>
  <p>but I cannot figure out the exact syntax.</p>
  <p>thanks</p>