I have used this line of code before release of iOS 10.3 ,and worked fine.
NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n%@",strMRP,strOffer]];
[attributeString addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:12] range:NSMakeRange(0, strMRP.length)];
[attributeString addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:15] range:NSMakeRange(strMRP.length, strOffer.length+1)];
[attributeString addAttribute:NSStrikethroughStyleAttributeName
value:[NSNumber numberWithInteger: NSUnderlineStyleDouble]
range:NSMakeRange(0,strMRP.length)];
But now it is stopped working ,is there any alternate way to do the strike out ?
it is the bug in iOS 10.3 , NSStrikethroughStyleAttributeName
(any NSUnderlineStyle
cases) is not working any more on iOS SDK 10.3.
if anyone found the updated answer related to this , please inform here, I will update my answer.
Product Version: 10.3
Created: 14-Mar-2017
Originated: 14-Mar-2017
Open Radar Link: http://www.openradar.appspot.com/31034683
Radar status is Currently Open state
you can see the alternate sample also here may be it useful.
I found one workaround on developer forum, which works for me. Adding of NSBaselineOffsetAttributeName
to string attributes fixed this problem :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With