Quantcast
Channel: Active questions tagged strikethrough - Stack Overflow
Viewing all articles
Browse latest Browse all 86

Why strikethrough is not working in iOS 14

$
0
0

I have one UILabel which shows strikethrough text (e.g. text). It was working fine till iOS 13. In iOS 14, that strikethrough line is not showing, i.e. instead of 'text', it is coming as 'text'. This is the code I used:

let totalString: String = "some text"let strikeString: String = "text" //string to be made strikethroughlet totalNsString = totalString as NSStringlet attributeString =  NSMutableAttributedString(string: totalString)attributeString.addAttribute(NSAttributedString.Key.strikethroughStyle, value: 2, range: totalNsString.range(of: strikeString))label.attributedText = attributeString

Desired Output:

some text

Current Outout:

some text

Can anyone please tell me is there anything I need to change or anything else. TIA.


Viewing all articles
Browse latest Browse all 86

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>