How would it be possible to include both bold and non-bold text in a uiLabel?
I'd rather not use a UIWebView.. I've also read this may be possible using NSAttributedString but I have no idea how to use that. Any ideas?
Apple achieves this in several of their apps; Examples Screenshot:
Thanks! - Dom
That's easy to do in Interface Builder:
1) make UILabel Attributed in Attributes Inspector
2) select part of phrase you want to make bold
3) change its font (or bold typeface of the same font) in font selector
That's all!
Check out TTTAttributedLabel. It's a drop-in replacement for UILabel that allows you to have mixed font and colors in a single label by setting an NSAttributedString as the text for that label.
Use the below code. I hope it help for you.
I've adopted Crazy Yoghurt's answer to swift's extensions.
May be there is not good conversion between Range and NSRange, but I didn't found something better.
To make text bold as well as underline in a UILabel. Just add the following lines in your code.
In this case you could try,