---
title: NSRange
framework: foundation
role: symbol
role_heading: Type Alias
path: foundation/nsrange-swift.typealias
---

# NSRange

A structure used to describe a portion of a series, such as characters in a string or objects in an array.

## Declaration

```swift
typealias NSRange = _NSRange
```

## Discussion

Discussion Foundation functions that operate on ranges include the following: NSEqualRanges(_:_:) NSIntersectionRange(_:_:) NSLocationInRange(_:_:) NSMakeRange(_:_:) NSMaxRange(_:) NSRangeFromString(_:) NSStringFromRange(_:) NSUnionRange(_:_:)

## Topics

### Creating a range

- [init()](foundation/nsrange-swift.typealias/init().md)
- [init(location:length:)](foundation/nsrange-swift.typealias/init(location:length:).md)

### Accessing range properties

- [location](foundation/nsrange-swift.typealias/location.md)
- [length](foundation/nsrange-swift.typealias/length.md)

### Managing ranges

- [NSEqualRanges(_:_:)](foundation/nsequalranges(_:_:).md)
- [NSIntersectionRange(_:_:)](foundation/nsintersectionrange(_:_:).md)
- [NSLocationInRange(_:_:)](foundation/nslocationinrange(_:_:).md)
- [NSMakeRange(_:_:)](foundation/nsmakerange(_:_:).md)
- [NSMaxRange(_:)](foundation/nsmaxrange(_:).md)
- [NSRangeFromString(_:)](foundation/nsrangefromstring(_:).md)
- [NSStringFromRange(_:)](foundation/nsstringfromrange(_:).md)
- [NSUnionRange(_:_:)](foundation/nsunionrange(_:_:).md)

### Related types

- [NSRangePointer](foundation/nsrangepointer.md)
- [NSNotFound](foundation/nsnotfound-4qp9h.md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomReflectable](swift/customreflectable.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
