Ho due arrayCome filtrare la matrice usando l'elemento in un'altra matrice in Swift?
let toBeFiltered = ["star0", "star2", "star1", "star0", "star3", "star4"]
let theFilter = ["star1", "star3"]
Come filtrare il primo array utilizzando la seconda matrice? In realtà il theFilter
può essere modificato dinamicamente, ad esempio,
let theFilter = ["star2"]
or maybe
let theFilter = ["star0", "star4", "star2"]
Grazie per il vostro aiuto :)
Fantastica spiegazione! Stavo usando 'Set' e' NSCountedSet', ma sembra che eseguirà molte delle stesse cose con meno linee di codice. – Adrian