Instance Method


Executes a given block using each object in the index set, in the specified ranges.


func enumerateRanges(_ block: (NSRange, UnsafeMutablePointer<ObjCBool>) -> Void)



The block to apply to elements in the index set.

The block takes two arguments:


The range of objects of the elements in the index set.


A reference to a Boolean value. The block can set the value to true to stop further processing of the array. The stop argument is an out-only argument. You should only ever set this Boolean to true within the Block.


If the Block parameter is nil this method will raise an exception.

This method executes synchronously.

See Also

Enumerating Index Set Content

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software