title: Swift array of objects conforms to a protocol
body: <p>I have a protocol like this:</p>
  
  <pre><code>protocol Datable {
      var date: NSDate { get set }
  }
  
  struct DEPref: Datable {
     var date: NSDate
  }
  
  struct DEPObs: Datable {
     var date: NSDate
  }
  
  func fetchDepRefs() -&gt; [DEPRef] {...}
  func fetchDepObss() -&gt; [DEPObs] {...}
  </code></pre>
  
  <p>I would like to create an array of <code>DEPref</code> and <code>DEPObs</code> in order to sort the final list.</p>
  
  <p>I have tried many things but the compiler complains. Example:</p>
  
  <pre><code>var depRefList: Array&lt;Datable&gt; = fetchDepRefs()
  var depObsList: Array&lt;Datable&gt; = fetchDepObss()
  var allDeps = ...
  </code></pre>
  
  <p>An error in the first line
  <strong>"Cannot convert value of type [DEPref] to specified type Array"</strong></p>