Collection
extension Collection
-
Returns an optional element. If the
indexdoes not exist in the collection, the subscript returns nil.Declaration
Swift
public subscript(safe i: Index) -> Self.Iterator.Element? { get }Parameters
safeThe index of the element to return, if it exists.
Return Value
An optional element from the collection at the specified index.
-
Returns an optional element. If the
indexdoes not exist in the collection, the function returns nil.Declaration
Swift
public func at(_ i: Index) -> Self.Iterator.Element?Parameters
indexThe index of the element to return, if it exists.
Return Value
An optional element from the collection at the specified index.
View on GitHub
Install in Dash
Collection Extension Reference