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: 
Swift 5 - short version

```swift
let attributedText = NSAttributedString(
    string: "Label Text",
    attributes: [.strikethroughStyle: NSUnderlineStyle.single.rawValue]
)

yourLabel.attributedText = attributedText

```
Change the text property to attributed and select the text and right click to get the font property. Click on the strikethrough.
![Screenshot](https://i.stack.imgur.com/jy7w2.png)