Question: I want to create a `UILabel` in which the text is like this

![enter image description here](https://i.stack.imgur.com/pTq7k.png)

How can I do this? When the text is small, the line should also be small.

Answer: 
On iOS 10.3 has an issue on rendering strikethrough line fixes by Adding a NSBaselineOffsetAttributeName, as explained here, to the attributed string brings back the strikethrough line. Overriding drawText:in: can be slow especially on Collection View or Table View Cells.

One sol - Add view to render a line.

Second sol -

```
attributeString.addAttribute(NSAttributedString.Key.strikethroughStyle, value: 2, range: NSMakeRange(0, attributeString.length))
attributeString.addAttribute(NSAttributedString.Key.baselineOffset, value: 2, range: NSMakeRange(0, attributeString.length))```

```
This is the one you can use in Swift 4 because NSStrikethroughStyleAttributeName has been changed to NSAttributedStringKey.strikethroughStyle

```
let attributeString: NSMutableAttributedString =  NSMutableAttributedString(string: "Your Text")

attributeString.addAttribute(NSAttributedStringKey.strikethroughStyle, value: 2, range: NSMakeRange(0, attributeString.length))

self.lbl.attributedText = attributeString

```