alexdrone / ios-fontawesome

NSString+FontAwesome
1.74k stars 254 forks source link

Icon + Text #55

Open abdullahumer opened 8 years ago

abdullahumer commented 8 years ago

Is there any way to add an icon + any text to a label or image?

e.g:

label.text = [NSString fontAwesomeIconStringForIconIdentifier:@"fa-github + myText"];
weng1250 commented 8 years ago

Yes. However, you should not assign ‘myText’ directly to IconIdentifier because fontawesome has no idea about what “fa-github+myText” is. The right way is NSString *fontIcontStr = [NSString fontAwesomeIconStringForIconIdentifier:@"fa-angle-double-right"]; NSString *text = [NSString stringWithFormat:@"%@ myText", fontIconStr]; [self.label setText:text];