title: SwiftUI, Xcode 13, Question about .filter'ing CoreData
body: <pre><code>@FetchRequest(
          entity: Client.entity(),
          sortDescriptors: [])
      private var clients: FetchedResults&lt;Client&gt;
  
  (...)
  
  var searchResults: FetchedResults&lt;Client&gt; {
              if searchText.isEmpty {
                  return clients
              } else {
                  return clients.filter({$0.name!.contains(searchText)}) // Error here!
              }
          }
  
  (...)
  
  ForEach(searchResults, id: \.self) { client in
  
  (...)
  
  </code></pre>
  <p>Error</p>
  <pre><code>Cannot convert return expression of type '[FetchedResults&lt;Client&gt;.Element]' (aka 'Array&lt;Client&gt;') to return type 'FetchedResults&lt;Client&gt;'
  </code></pre>
  <p>Hi,</p>
  <p>I'm not sure how my logic is wrong. Could someone please tell me how to fix searchResults?</p>
  <p>Also, is this the more efficient way to filter results or should I filter in the ForEach()? It seems pretty slow when I put the filter in ForEach()</p>