title: Using a Generic Type with a Protocol and associated type?
body: <p>I am trying to create a class that can be described as a) keeping a property of a certain type, say T, and keeping a property of another type that can update that same type, T. I think it is better explained through my (non working) example: </p>
  
  <pre><code>protocol Updater {
       associatedtype UpdateType
       func update(withSuccess success: ((UpdateType) -&gt; Void)?, failure: ((NSError) -&gt; Void)?)
  }
  
  class MyContainer&lt;T&gt; {
       private(set) var object: T
       private(set) var updater: Updater
  }
  </code></pre>
  
  <p>In the above example, I want to ensure that the <code>associatedtype</code> of the protocol matches the generic type of <code>myContainer</code></p>
  
  <p>Is this possible to do in swift?</p>
  
  <p>Thansk!</p>