1

I want to include png image in between my text of a label. how to proceed with this in objective-c.

2

1 Answer 1

1

This is the answer in case someone find it useful----->

 NSTextAttachment *attachment = [[NSTextAttachment alloc] init]; attachment.image = [UIImage imageNamed:@"Attach-52.png"]; NSAttributedString *attachmentString = [NSAttributedString attributedStringWithAttachment:attachment]; NSMutableAttributedString *myString= [[NSMutableAttributedString alloc] initWithString:@"My label text"]; [myString appendAttributedString:attachmentString]; myLabel.attributedText = myString; 

Likewise you can add png image through NSAttributedString.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.