A type that can be used to slice a collection.
SDK
- Xcode 9.0+
Framework
- Swift Standard Library
Declaration
Overview
A type that conforms to Range
can convert itself to a Range<Bound>
of indices within a given collection.
A type that can be used to slice a collection.
SDK
Framework
A type that conforms to Range
can convert itself to a Range<Bound>
of indices within a given collection.
associatedtype Bound
The type for which the expression describes a range.
Required.
func contains(Self .Bound) -> Bool
Returns a Boolean value indicating whether the given element is contained within the range expression.
Required.
func relative<C>(to: C) -> Range<Self .Bound>
Returns the range of indices described by this range expression within the given collection.
Required.
struct Partial Range Up To
A partial half-open interval up to, but not including, an upper bound.
struct Partial Range Through
A partial interval up to, and including, an upper bound.
struct Partial Range From
A partial interval extending upward from a lower bound.
enum Unbounded Range_
A range expression that represents the entire range of a collection.