title: Xcode 9.4.1 Swift 4 - Comparing a non-primitive Set to a primitive set containing Int
body: <p>I am stumped on how to approach this scenario as I cannot figure out how to check if a single value within each list of the listGroup Exists before returning true and if one value is missing from one of the 4 lists the func must return false.</p>
  
  <p>The list pasted through will have a data structure containing id, name, group
  Example of the object passed through within objList:
  Object - id: Int,  name: String, group: String </p>
  
  <pre><code>init(){ 
      //contains value which will match objList id's
      let list1 : Set&lt;Int&gt; = [1,2] 
      let list2 : Set&lt;Int&gt; = [3,4] 
      let list3 : Set&lt;Int&gt; = [5,6,7] 
      let list4 : Set&lt;Int&gt; = [8,9]
  
      //Set of Sets
      listGroups = [list1,list2,list3,list4] 
  }
  
  func checklist(_ objList: [Details]) -&gt; Bool { 
      //I want to check that each sub set(list1-list4) elements exist 
      //E.G. if objList contains 2, 3, 7, 8, 15, 21 it will return true 
      //and if objList contains 1, 4, 7, return false as it doesn't contain a  
      //number from each set 
  
      //How I thought to approach but became stuck
      for obj in objList {
          for set in listGroups {
              if set.contains(i.id){
                  //return true if objList contains numbers from list1, list2, list3 and list4
              }
          }
      }
      //I require an id from each list to be present in the objList
      //but how would i know which set had which id and count how many group of 4 
      //there would be
  }
  </code></pre>
  
  <p>The "Details" passed through contain details about them, however what I want to do is check whether the Int within the listGroups exist within the objList passed through. However the func can only return true if a value from each of the sub-sets of listGroups exists.</p>
  
  <p>A single value from all 4 subsets must be present before I can return true and if a single one or more is missing func must return false</p>