<!--
{
  "documentType" : "article",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Range/Collection-Implementations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Collection Implementations"
}
-->

# Collection Implementations

## Topics

### Instance Properties

[`var endIndex: Range<Bound>.Index`](/documentation/Swift/Range/endIndex)

The collection’s “past the end” position—that is, the position one
greater than the last valid subscript argument.

[`var indices: Range<Bound>.Indices`](/documentation/Swift/Range/indices-swift.property)

The indices that are valid for subscripting the range, in ascending
order.

[`var startIndex: Range<Bound>.Index`](/documentation/Swift/Range/startIndex)

The position of the first element in a nonempty collection.

### Instance Methods

[`func distance(from: Range<Bound>.Index, to: Range<Bound>.Index) -> Int`](/documentation/Swift/Range/distance(from:to:))

Returns the distance between two indices.

[`func index(Range<Bound>.Index, offsetBy: Int) -> Range<Bound>.Index`](/documentation/Swift/Range/index(_:offsetBy:))

Returns an index that is the specified distance from the given index.

[`func index(after: Range<Bound>.Index) -> Range<Bound>.Index`](/documentation/Swift/Range/index(after:))

Returns the position immediately after the given index.

### Subscripts

[`subscript(Range<Range<Bound>.Index>) -> Range<Bound>`](/documentation/Swift/Range/subscript(_:)-358vm)

Accesses the subsequence bounded by the given range.

[`subscript(Range<Bound>.Index) -> Range<Bound>.Element`](/documentation/Swift/Range/subscript(_:)-84ykx)

Accesses the element at specified position.

### Type Aliases

[`typealias Index`](/documentation/Swift/Range/Index)

A type that represents a position in the range.

[`typealias Indices`](/documentation/Swift/Range/Indices-swift.typealias)

A type that represents the indices that are valid for subscripting the
collection, in ascending order.

[`typealias SubSequence`](/documentation/Swift/Range/SubSequence)

A collection representing a contiguous subrange of this collection’s
elements. The subsequence shares indices with the original collection.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)