IndexDistance

A type that represents the number of steps between two String.Index values, where one value is reachable from the other.

This declaration is deprecated: All index distances are now of type Int

You’re reading documentation from an older version of Swift 6.1.

A symbol with the same signature as this one exists in the latest stable release of Swift 6.1.

typealias IndexDistance = Int

In Swift, reachability refers to the ability to produce one value from the other through zero or more applications of index(after:).