objects(options:passingTest:)
Returns a set of objects that pass a test in a given block, using the specified enumeration options.
Declaration
func objects(options opts: NSEnumerationOptions = [], passingTest predicate: (Any, UnsafeMutablePointer<ObjCBool>) -> Bool) -> Set<AnyHashable>Parameters
- opts:
A bitmask that specifies the options for the enumeration.
- predicate:
The block to apply to elements in the set.
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.