---
title: "strikethroughGlyphRange(_:strikethroughType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nslayoutmanager/strikethroughglyphrange(_:strikethroughtype:linefragmentrect:linefragmentglyphrange:containerorigin:)"
---

# strikethroughGlyphRange(_:strikethroughType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:)

Calculates and draws strikethrough for the specified glyphs.

## Declaration

```swift
func strikethroughGlyphRange(_ glyphRange: NSRange, strikethroughType strikethroughVal: NSUnderlineStyle, lineFragmentRect lineRect: CGRect, lineFragmentGlyphRange lineGlyphRange: NSRange, containerOrigin: CGPoint)
```

## Parameters

- `glyphRange`: The range of glyphs for which to draw a strikethrough. The range must belong to a single line fragment rectangle (as returned by doc://com.apple.uikit/documentation/UIKit/NSLayoutManager/lineFragmentRect(forGlyphAt:effectiveRange:)).
- `strikethroughVal`: The style of underlining to draw. This value is a mask derived from the value for doc://com.apple.uikit/documentation/UIKit/NSUnderlineStyleAttributeName—for example, (NSUnderlinePatternDash | NSUnderlineStyleThick | NSUnderlineByWordMask). Subclasses can define custom underlining styles.
- `lineRect`: The line fragment rectangle containing the glyphs to draw strikethrough for.
- `lineGlyphRange`: The range of all glyphs within lineRect.
- `containerOrigin`: The origin of the line fragment rectangle’s NSTextContainer in its NSTextView.

## Discussion

Discussion This method determines which glyphs actually need to have a strikethrough drawn based on strikethroughVal. After determining which glyphs to draw strikethrough on, this method invokes drawStrikethrough(forGlyphRange:strikethroughType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:) for each contiguous range of glyphs that requires it.

## See Also

### Drawing

- [drawBackground(forGlyphRange:at:)](uikit/nslayoutmanager/drawbackground(forglyphrange:at:).md)
- [drawGlyphs(forGlyphRange:at:)](uikit/nslayoutmanager/drawglyphs(forglyphrange:at:).md)
- [drawStrikethrough(forGlyphRange:strikethroughType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:)](uikit/nslayoutmanager/drawstrikethrough(forglyphrange:strikethroughtype:baselineoffset:linefragmentrect:linefragmentglyphrange:containerorigin:).md)
- [drawUnderline(forGlyphRange:underlineType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:)](uikit/nslayoutmanager/drawunderline(forglyphrange:underlinetype:baselineoffset:linefragmentrect:linefragmentglyphrange:containerorigin:).md)
- [fillBackgroundRectArray(_:count:forCharacterRange:color:)](uikit/nslayoutmanager/fillbackgroundrectarray(_:count:forcharacterrange:color:).md)
- [showCGGlyphs(_:positions:count:font:textMatrix:attributes:in:)](uikit/nslayoutmanager/showcgglyphs(_:positions:count:font:textmatrix:attributes:in:).md)
- [underlineGlyphRange(_:underlineType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:)](uikit/nslayoutmanager/underlineglyphrange(_:underlinetype:linefragmentrect:linefragmentglyphrange:containerorigin:).md)
