You may mean Strike,iOS 6.0 and upper , UILabel
supports NSAttributedString
and NSMutableAttributedString
When use NSAttributedString
NSAttributedString * title =
[[NSAttributedString alloc] initWithString:@"Your String here"
attributes:@{NSStrikethroughStyleAttributeName:@(NSUnderlineStyleSingle)}];
[label setAttributedText:title];
Definition :
/**
* Returns an NSAttributedString object initialized with a given string and
attributes.
*
* @param str : The string for the new attributed string.
* @param attrs : The attributes for the new attributed string. For information
* about where to find the attribute keys you can include in this dictionary,
* see the overview section of this document.
*
* @return
Returns an NSAttributedString object initialized with the characters of aString and the attributes of attributes. The returned object might be different from the original receiver.
*/
- (instancetype)initWithString:(NSString *)str attributes:(NSDictionary *)attrs;
When use NSMutableAttributedString
NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:@"Your String here"];
[attributeString addAttribute:NSStrikethroughStyleAttributeName
value:@2
range:NSMakeRange(0, [attributeString length])];
Definition :
/**
*
* @param name : A string specifying the attribute name. Attribute keys can be
* supplied by another framework or can be custom ones you define. For
* information about where to find the system-supplied attribute keys, see the
* overview section in NSAttributedString Class Reference.
*
* @param value : The attribute value associated with name.
*
* @param aRange : The range of characters
* to which the specified attribute/value pair applies.
*/
- (void)addAttribute:(NSString *)name value:(id)value range:(NSRange)aRange;
Then
yourLabel.attributedText = attributeString;