---
title: IndexSet.RangeView
framework: foundation
role: symbol
role_heading: Structure
path: foundation/indexset/rangeview-swift.struct
---

# IndexSet.RangeView

A view of the contents of an IndexSet, organized by range.

## Declaration

```swift
struct RangeView
```

## Overview

Overview For example, if an IndexSet is composed of: [1..<5] and [7..<10] and [13] then calling next() on this view’s iterator will produce 3 ranges before returning nil.

## Topics

### Counting Indexes

- [count](foundation/indexset/count.md)
- [endIndex](foundation/indexset/rangeview-swift.struct/endindex.md)
- [first](foundation/indexset/first.md)
- [isEmpty](foundation/indexset/isempty.md)
- [last](foundation/indexset/last.md)
- [startIndex](foundation/indexset/rangeview-swift.struct/startindex.md)

### Accessing Indexes

- [subscript(_:)](foundation/indexset/rangeview-swift.struct/subscript(_:)-5r66q.md)
- [subscript(_:)](foundation/indexset/rangeview-swift.struct/subscript(_:)-8gh0x.md)

### Finding Indexes

- [startIndex](foundation/indexset/rangeview-swift.struct/startindex.md)
- [endIndex](foundation/indexset/rangeview-swift.struct/endindex.md)
- [index(after:)](foundation/indexset/rangeview-swift.struct/index(after:).md)
- [index(before:)](foundation/indexset/rangeview-swift.struct/index(before:).md)

### Iterating over Indexes

- [makeIterator()](foundation/indexset/rangeview-swift.struct/makeiterator().md)

### Testing for Inclusion in the Range

- [contains(_:)](foundation/indexset/contains(_:).md)
- [index(after:)](foundation/indexset/rangeview-swift.struct/index(after:).md)
- [index(before:)](foundation/indexset/rangeview-swift.struct/index(before:).md)
- [makeIterator()](foundation/indexset/rangeview-swift.struct/makeiterator().md)

### Type Aliases

- [IndexSet.RangeView.Index](foundation/indexset/rangeview-swift.struct/index.md)

## Relationships

### Conforms To

- [BidirectionalCollection](swift/bidirectionalcollection.md)
- [Collection](swift/collection.md)
- [Equatable](swift/equatable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [Sequence](swift/sequence.md)

## See Also

### Getting a Range-Based View

- [rangeView(of:)](foundation/indexset/rangeview(of:)-5xqe8.md)
- [rangeView](foundation/indexset/rangeview-swift.property.md)
