<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Dictionary/Index",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:SD5IndexV"
  },
  "title" : "Dictionary.Index"
}
-->

# Dictionary.Index

The position of a key-value pair in a dictionary.

```
@frozen struct Index
```

## Overview

Dictionary has two subscripting interfaces:

1. Subscripting with a key, yielding an optional value:
   
   ```
   v = d[k]!
   ```
2. Subscripting with an index, yielding a key-value pair:
   
   ```
   (k, v) = d[i]
   ```

## Topics

### Default Implementations

[Comparable Implementations](/documentation/Swift/Dictionary/Index/Comparable-Implementations)

[Equatable Implementations](/documentation/Swift/Dictionary/Index/Equatable-Implementations)

[Hashable Implementations](/documentation/Swift/Dictionary/Index/Hashable-Implementations)

## Relationships

### Conforms To

[`Comparable`](/documentation/Swift/Comparable)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)