What is the best solution for striking out text on an iPhone?
I have heard of several solutions:
UIWebView
NSAttributedString
In iOS 6, we can use "NSMutableAttributedString" to use more different styles.
NSString* cutText = @"This Line is strike out."; NSMutableAttributedString *titleString = [[NSMutableAttributedString alloc] initWithString:cutText]; // making text property to strike text- NSStrikethroughStyleAttributeName [titleString addAttribute:NSStrikethroughStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0, [titleString length])]; // using text on label [myTextLabel setAttributedText:titleString];
You can try my solution for a subclass of UILabel that supports:
multi-line text with different label borders (the text may be in the middle of the label frame or the exact size)
https://github.com/GuntisTreulands/UnderLineLabel