title: Boolean statement for multiple filtering Swift
body: <p>I'm currently creating an app in Swift 4.2 which I'd like a filtering feature in place which allows the user to select multiple filters.</p>
  
  <p>I have an array of the currently selected filters, for example ["Low", "Unread"]. I also have an array of the objects being filtered. But I'm struggling to figure out how to apply multiple filters to this array, especially due to the objects have children which in turn have properties which are filtered against. For example object array holds bulletin.importance.name which is the property that "Low" would be checked against.</p>
  
  <p>The following code is a boolean returning function which will get the filters to be used on the array of bulletin objects:</p>
  
  <pre><code>return (bulletin.bulletinVersion?.issued == true) &amp;&amp; (scopes.contains("All") || (scopes.contains((bulletin.bulletinVersion?.bulletin?.importance?.name)!) ||
          (!scopes.contains(where: {$0 == "Low" || $0 == "Normal" || $0 == "High"}))) &amp;&amp; (scopes.contains(bulletin.read(i: bulletin.firstReadDate)) ||
              (!scopes.contains(where: {$0 == "Unread"}))) &amp;&amp;
              (scopes.contains(bulletin.signed(i: bulletin.signDate)) &amp;&amp; bulletin.bulletinVersion?.bulletin?.requiresSignature == true) &amp;&amp; scopes.contains(bulletin.favourited(i: bulletin.favourite)))
  </code></pre>
  
  <p>This is my current attempt of the boolean check. I wish for it to be hard set so if the user selects "High" and "Unread" it will only show objects which match both of those filters.</p>
  
  <p>The function is called here, getting the filters and filtering an array of ALL bulletins into which ones should be shown based upon the filters:</p>
  
  <pre><code>currentBulletinArray = bulletinArray.filter({bulletin -&gt; Bool in
      let doesCategoryMatch = getScopeFilters(issued: true, scopes: scope, bulletin: bulletin, signature: true)
  
      if searchBarIsEmpty(){
          return doesCategoryMatch
      } else {
          return doesCategoryMatch &amp;&amp; (bulletin.bulletinVersion?.bulletin?.name?.lowercased().contains(searchText.lowercased()))!
      }
     })
  </code></pre>
  
  <p>I want to be able to set any combination of filters, where the returning .filter predicate will show only the bulletins which match ALL the filters.
  So, Unread + Unsigned + High will show all High Importance bulletins where they are unread and unsigned.</p>