Tested on the Playground of Xcode 8.3.3.import UIKit let oldpricenameLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 320, height: 120)) let productView = UIView(frame: CGRect(x: 0, y: 0, width: 320, height: 120)) let decodedString = Rp 514.800 var style = [NSStrikethroughStyleAttributeName: 2] let attributeString = NSMutableAttributedString(string: decodedString, attributes: style) oldpricenameLabel.attributedText = attributeString oldpricenameLabel.backgroundColor = UIColor.yellow productView.addSubview(oldpricenameLabel)With Quick Look into `productView`, I get something like this:Rp 514.800Seems this code acutally works.Please show enough code to reproduce your issue. I believe you can try with your Playground.