<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextSelection/Granularity-swift.enum",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@E@NSTextSelectionGranularity"
  },
  "title" : "NSTextSelection.Granularity"
}
-->

# NSTextSelection.Granularity

Values that describe the different granularities available to make a selection.

```
enum Granularity
```

## Topics

### Degrees of granularity

[`case character`](/documentation/AppKit/NSTextSelection/Granularity-swift.enum/character)

A value that represents selection by character.

[`case word`](/documentation/AppKit/NSTextSelection/Granularity-swift.enum/word)

A value that represents selection by word.

[`case paragraph`](/documentation/AppKit/NSTextSelection/Granularity-swift.enum/paragraph)

A value that represents selection by paragraph.

[`case line`](/documentation/AppKit/NSTextSelection/Granularity-swift.enum/line)

A value that represents selection by line.

[`case sentence`](/documentation/AppKit/NSTextSelection/Granularity-swift.enum/sentence)

A value that represents selection by sentence.

### Initializers

[`init?(rawValue: Int)`](/documentation/AppKit/NSTextSelection/Granularity-swift.enum/init(rawValue:))

## Relationships

### Conforms To

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

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

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

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

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

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

---

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)