I need to concatenate text with an image then display the result string on a label. I have done this
But at the end label displays like "My label text..."
How can i display that image with the text on UILabel?
Code:
NSTextAttachment *attachment = [[NSTextAttachment alloc] init];
attachment.image = [UIImage imageNamed:@"1"];
NSAttributedString *attachmentString = [NSAttributedString attributedStringWithAttachment:attachment];
NSMutableAttributedString *myString= [[NSMutableAttributedString alloc] initWithString:@"My label text"];
[myString appendAttributedString:attachmentString];
textLabel.attributedText = myString;
But at the end label displays like "My label text..."
How can i display that image with the text on UILabel?