<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSTextLayoutManager/SegmentOptions",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@E@NSTextLayoutManagerSegmentOptions"
  },
  "title" : "NSTextLayoutManager.SegmentOptions"
}
-->

# NSTextLayoutManager.SegmentOptions

Values that describe where and how the framework extends segments of a selection.

```
struct SegmentOptions
```

## Topics

### Creating segment options

[`init(rawValue: UInt)`](/documentation/UIKit/NSTextLayoutManager/SegmentOptions/init(rawValue:))

Cceates a new segment option using the value you provide.

### Getting segment options

[`static var headSegmentExtended: NSTextLayoutManager.SegmentOptions`](/documentation/UIKit/NSTextLayoutManager/SegmentOptions/headSegmentExtended)

Returns the value that causes the framework to extend the segment to the tail edge.

[`static var middleFragmentsExcluded: NSTextLayoutManager.SegmentOptions`](/documentation/UIKit/NSTextLayoutManager/SegmentOptions/middleFragmentsExcluded)

Returns the value that causes the framework to enumerate segments in only the first and last line fragments.

[`static var rangeNotRequired: NSTextLayoutManager.SegmentOptions`](/documentation/UIKit/NSTextLayoutManager/SegmentOptions/rangeNotRequired)

Returns the value that causes the framework enumerate text segment rectangles, but avoids preparing a range object.

[`static var tailSegmentExtended: NSTextLayoutManager.SegmentOptions`](/documentation/UIKit/NSTextLayoutManager/SegmentOptions/tailSegmentExtended)

Returns the value that causes the framework to extend the segment to the tail edge.

[`static var upstreamAffinity: NSTextLayoutManager.SegmentOptions`](/documentation/UIKit/NSTextLayoutManager/SegmentOptions/upstreamAffinity)

Returns the value that causes the framework to the place the segment based on the upstream affinity for an empty range.

### Constants that describe segment options

[`NSTextLayoutManagerSegmentOptionsNone`](/documentation/UIKit/NSTextLayoutManagerSegmentOptions/NSTextLayoutManagerSegmentOptionsNone)

The value that represents the empty options set.

## Relationships

### Conforms To

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

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

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

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

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

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

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

[`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)