Swift associatedType from protocol type - how to do that?
<p>I'm having issues using associated type as protocol:</p>

<pre><code>protocol Searchable{    
    func matches(text: String) -&gt; Bool
}

protocol ArticleProtocol: Searchable {
    var title: String {get set}
}

extension ArticleProtocol {
    func matches(text: String) -&gt; Bool {
        return title.containsString(text)
    }
}

struct FirstArticle: ArticleProtocol {
      var title: String = ""
}

struct SecondArticle: ArticleProtocol {
      var title: String = ""
}

protocol SearchResultsProtocol: class {    
    associatedtype T: Searchable
}
</code></pre>

<p>When I try to implement search results protocol, I get compile issue:</p>

<p>"type SearchArticles does not conform to protocol SearchResultsProtocol"</p>

<pre><code>class SearchArticles: SearchResultsProtocol {
   typealias T = ArticleProtocol
}
</code></pre>

<p>As I understand, it happens because T in SearchArticles class is not from concrete type (struct in that example), but from protocol type.</p>

<p>Is there a way to solve this issue?</p>

<p>Thanks in advance!</p>