I am working with a label which shows the old price of a product with strikethrough attribute. I am trying to set the strikethrough property for the attributed string but could not get the actual result.
let price = 1000.0
let currencyFormatter = NumberFormatter()
currencyFormatter.numberStyle = .currency
currencyFormatter.currencyCode = "INR"
let priceInINR = currencyFormatter.string(from: price as NSNumber)
let attributedString = NSMutableAttributedString(string: priceInINR!)
attributedString.addAttribute(NSStrikethroughStyleAttributeName, value: 1, range: NSMakeRange(0, attributedString.length))
self.oldPriceLabel.attributedText = attributedString
Is there any way to set the currency formatter and strikethrough attributes simultaneously for a string?