<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSUnderlineStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@E@NSUnderlineStyle"
  },
  "title" : "NSUnderlineStyle"
}
-->

# NSUnderlineStyle

Constants for the underline style and strikethrough style attribute keys.

```
struct NSUnderlineStyle
```

## Overview

Use these constants to specify the [`NSUnderlineStyleAttributeName`](/documentation/UIKit/NSUnderlineStyleAttributeName) and [`NSStrikethroughStyleAttributeName`](/documentation/UIKit/NSStrikethroughStyleAttributeName) attributes of an attributed string.

## Topics

### Getting the line style

[`NSUnderlineStyleNone`](/documentation/UIKit/NSUnderlineStyle/NSUnderlineStyleNone)

Don’t draw a line.

[`NSUnderlineStyleSingle`](/documentation/UIKit/NSUnderlineStyle/single)

Draw a single line.

[`NSUnderlineStyleThick`](/documentation/UIKit/NSUnderlineStyle/thick)

Draw a thick line.

[`NSUnderlineStyleDouble`](/documentation/UIKit/NSUnderlineStyle/double)

Draw a double line.

[`NSUnderlineStylePatternSolid`](/documentation/UIKit/NSUnderlineStyle/NSUnderlineStylePatternSolid)

Draw a solid line.

[`NSUnderlineStylePatternDot`](/documentation/UIKit/NSUnderlineStyle/patternDot)

Draw a line of dots.

[`NSUnderlineStylePatternDash`](/documentation/UIKit/NSUnderlineStyle/patternDash)

Draw a line of dashes.

[`NSUnderlineStylePatternDashDot`](/documentation/UIKit/NSUnderlineStyle/patternDashDot)

Draw a line of alternating dashes and dots.

[`NSUnderlineStylePatternDashDotDot`](/documentation/UIKit/NSUnderlineStyle/patternDashDotDot)

Draw a line of alternating dashes and two dots.

[`NSUnderlineStyleByWord`](/documentation/UIKit/NSUnderlineStyle/byWord)

Draw the line only beneath or through words, not whitespace.

### Initializers

[`init(_:)`](/documentation/UIKit/NSUnderlineStyle/init(_:))

Creates a [`NSUnderlineStyle`](/documentation/UIKit/NSUnderlineStyle) from `Text.LineStyle`.

[`init(rawValue:)`](/documentation/UIKit/NSUnderlineStyle/init(rawValue:))

Creates an underline style with the specified raw value.

### Deprecated

[`NSUnderlinePatternSolid`](/documentation/UIKit/NSUnderlinePatternSolid)

A solid line.

[`NSUnderlinePatternDot`](/documentation/UIKit/NSUnderlinePatternDot)

A line of dots.

[`NSUnderlinePatternDash`](/documentation/UIKit/NSUnderlinePatternDash)

A line of dashes.

[`NSUnderlinePatternDashDot`](/documentation/UIKit/NSUnderlinePatternDashDot)

A line of alternating dashes and dots.

[`NSUnderlinePatternDashDotDot`](/documentation/UIKit/NSUnderlinePatternDashDotDot)

A line of alternating dashes and two dots.

[`NSUnderlineByWord`](/documentation/UIKit/NSUnderlineByWord)

A line only beneath or through words, not whitespace.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

---

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)