Screen Shot 2016-02-19 at 17.00.27

Convenient NSTextAttachment image resizing

Today i was faced with the task of building a dynamic NSAttributedString consiting of arbitrary text and icons. Obviously all the icons had to match the text size. Starting point This can be accomplished by just setting the bounds of the NSTextAttachment like so: textAttachment.bounds = CGRectMake(0, 0, 16, 16) Sure, that works but it’s not a very…