swift - Unable to subtract two sets containing two dictonaries -


// compare 2 arrays getting result same first set

    let precontactset = set(arrayliteral: temppreviouscontactarray )     let currentcontactset = set(arrayliteral: tempcurrentcontactarray)     let subtractset =  currentcontactset.intersect(precontactset)     print(subtractset) 

you can subtract 2 set using following code. try hope you.

let test1 : nsarray = nsarray(array: [1, 2, 3, 4, 5, 6]) let test2 : nsarray = nsarray(array: [4, 3]) let set1 : nsmutableset = nsmutableset(array: test1 [anyobject]) let set2:nsset = nsset(array: test2 [anyobject]) set1.intersectset(set2 set<nsobject>) print(set1.allobjects) 

Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -