Swift 4 – Array Contains Value

Easiest way:

let’s say you have an array

let check = c.sections.contains { $0.idaudits_sections == needle }

// check returns true if a match is found. $0 is the iterator, through this abstract object it is possible to access the objects content

Leave a Reply

Your email address will not be published. Required fields are marked *