Collection
extension Collection where Indices.Iterator.Element == Index
-
Avoid ‘out of range’ fatal errors
Note
Don’t useindicesbecause it will loop over all elementsDeclaration
Swift
subscript(safe index: Index) -> Iterator.Element?
View on GitHub