Collection

extension Collection where Indices.Iterator.Element == Index

Available where Indices.Iterator.Element == Index

  • Avoid ‘out of range’ fatal errors

    Note

    Don’t use indices because it will loop over all elements

    Declaration

    Swift

    subscript(safe index: Index) -> Iterator.Element?