title: How Filter Custom Object Array with Condition
body: <p>I have Item Class  </p>
  
  <pre><code> class Item {
          var id:Int
          var name:String
          var value:Int
          var isDefault:Bool
      }
  </code></pre>
  
  <p>On basis of Class Item i have 2 array of [Item] class i want to merge this array with replacing object in first array with second if id is matched and all remaining array in (first/second) should be appended</p>
  
  <pre><code>let fisrt = Item(id: 1, name: "A", value: 3, isDefault:false)
  let second = Item(id: 2, name: "B", value:5,isDefault:false)
  let third = Item(id: 3, name: "c", value:5,isDefault:false)
  
  var fisrtArray = [fisrt, second, third]
  
  let fisrt2 = Item(id: 4, name: "P", value: 13, isDefault:true)
  let second2 = Item(id: 2, name: "Q", value:15, isDefault:true)
  let third2 = Item(id: 7, name: "R", value:15,  isDefault:true)
  let forth2 = Item(id: 8, name: "S", value:18,  isDefault:true)
  
  var secondArray = [fisrt2, second2, third2,forth2] 
  </code></pre>
  
  <p>So my Resulted Array should be </p>
  
  <pre><code>Item(id: 1, name: "A", value: 3, isDefault:false)
  Item(id: 2, name: "Q", value:5,isDefault:true)
  Item(id: 3, name: "c", value:5,isDefault:false)
  Item(id: 4, name: "P", value: 13, isDefault:true)
  Item(id: 7, name: "R", value:15,  isDefault:true)
  Item(id: 8, name: "S", value:18,  isDefault:true)
  </code></pre>
  
  <blockquote>
    <p>Note: size of array may be any thing either firstArray is large or
    Second its not dependent. I do it with for loop but i think there other way of doing it </p>
  </blockquote>