objects(passingTest:)
Returns a set of objects that pass a test in a given block.
Declaration
func objects(passingTest predicate: (Any, UnsafeMutablePointer<ObjCBool>) -> Bool) -> Set<AnyHashable>Parameters
- predicate:
The block to apply to elements in the array.
The block takes two arguments:
- obj
The element in the set.
- stop
A reference to a Boolean value. The block can set the value to True to stop further processing of the set. The
stopargument is an out-only argument. You should only ever set this Boolean to True within the block.
The block returns a Boolean value that indicates whether
objpassed the test.
Return Value
An NSSet containing objects that pass the test.