How can I underline text in a UITextView
. I understand that I would need to create a subclass of UITextView
, but what would go under drawRect
You can't use "kCTUnderlineStyleAttributeName" or "kCTUnderlineStyleSingle" Now you must do it like this:
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:@"Text"];
[attString addAttribute:NSUnderlineStyleAttributeName
value:@(NSUnderlineStyleSingle)
range:(NSRange){0,[attString length]}];