I am looking to create a design similar to this concept.
https://i.sstatic.net/7ZQi3.png
One approach is to achieve this by inserting an image (for "PDF").
NSTextAttachment *attachment = [[NSTextAttachment alloc] init]; attachment.image = [UIImage imageNamed:@"MyIcon.png"];
NSAttributedString *attachmentString = [NSAttributedString attributedStringWithAttachment:attachment];
NSMutableAttributedString *myString= [[NSMutableAttributedString alloc] initWithString:@"My label text"]; [myString appendAttributedString:attachmentString];
myLabel.attributedText = myString;
However, I am uncertain about the effectiveness of this method. Is there an alternative solution available? Could I emphasize the word 'PDF' with a background that has rounded corners? While I can easily set the text background color using an attributed string, it lacks the ability to create rounded corners.