The position after this position in the underlying collection.
- Xcode 10.0+
- Swift Standard Library
To find the position that corresponds with this index in the original, underlying collection, use that collection’s
index(before:) method with the
The following example declares a function that returns the index of the last even number in the passed array, if one is found. First, the function finds the position of the last even number as a
Reversed in a reversed view of the array of numbers. Next, the function calls the array’s
index(before:) method to return the correct position in the passed array.