enumerateRanges(in:options:using:)
Enumerates over the ranges in the range of objects using the block
Declaration
func enumerateRanges(in range: NSRange, options opts: NSEnumerationOptions = [], using block: (NSRange, UnsafeMutablePointer<ObjCBool>) -> Void)Parameters
- range:
The range of items to enumerate. If the range intersects a range of the receiver’s indexes, then that intersection will be passed to the block.
- opts:
A bitmask that specifies the Nsenumerationoptions for the enumeration.
- block:
The block to apply to elements in the index set.
The block takes two arguments:
Discussion
By default, the enumeration starts with the first object and continues serially through the indexed set range to the last object in the range. You can specify NSEnumerationConcurrent and/or NSEnumerationReverse as enumeration options to modify this behavior.
This method executes synchronously.