I want to create a UILabel
in which the text is like this
How can I do this? When the text is small, the line should also be small.
I want to create a UILabel
in which the text is like this
How can I do this? When the text is small, the line should also be small.
Use below code
SWIFT CODE
then:
Thanks to Prince answer ;)
Change the text property to attributed and select the text and right click to get the font property. Click on the strikethrough.
Create String extension and add below method
then use for your label like this
For anyone looking on how to do this in a tableview cell (Swift) you have to set the .attributeText like this:
If you want to remove the strikethrough do this otherwise it will stick around!:
Swift 5
Example: