Last active
August 29, 2015 14:07
-
-
Save AdiletAbylov/558977f43d856b8cf601 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSTextAttachment *attachment = [NSTextAttachment new]; | |
attachment.image = [[UIImage imageNamed:@"iconBookmarkhint.png"] resizedImageToFitInSize:(CGSize){10,10} scaleIfSmaller:YES]; | |
NSMutableAttributedString *imageAttrString = [[NSAttributedString attributedStringWithAttachment:attachment] mutableCopy]; | |
NSMutableAttributedString *attributedString1 = [[NSMutableAttributedString alloc] initWithString:@"To save a chat message, tap and hold the message and use the" | |
attributes:@{NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Light" size:13], | |
NSForegroundColorAttributeName : [UIColor blackColor]}]; | |
NSAttributedString *attributedString2 = [[NSAttributedString alloc] initWithString:@"button" | |
attributes:@{NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Light" size:13], | |
NSForegroundColorAttributeName : [UIColor blackColor]}]; | |
[attributedString1 appendAttributedString:imageAttrString]; | |
[attributedString1 appendAttributedString:attributedString2]; | |
self.label.text = nil; | |
self.label.attributedText = attributedString1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment