Strikethrough Text

NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:(text ? text : @"")];
[attributeString addAttribute:NSStrikethroughStyleAttributeName
                        value:@2
                        range:NSMakeRange(0, [attributeString length])];
//can use NSStrikethroughColorAttributeName to change strikethrough color
label.attributedText = attributeString;

你可能感兴趣的:(text)