Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJack Leonard
2,894 PointsBold & Non-Bold Text In A Single UILabel?
I was wondering if its possible to have two separate font sizes/styles for two different parts of the same string: (See picture) ![Example of two different font sizes in same string][1]
http://i.stack.imgur.com/sUv5z.png
Is there any possible way to do this without going to the hassle of combining two strings, (Basically I'm pulling quotes from an array but I want to have who said the quote in a different font size/style from the quote itself)
// I believe it has something to do with attributed text but still have no idea..
Kind Regards,
Jack
2 Answers
Steve Hunter
57,712 PointsThere's a helpful Stack Overflow question on this point:
http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel
Steve Hunter
57,712 PointsThis might help, then.
http://makeapppie.com/2014/10/20/swift-swift-using-attributed-strings-in-swift/
Jack Leonard
2,894 PointsJack Leonard
2,894 PointsLooked at it already, It seems to be for Objective-C though, I'm looking for an answer in Swift. Thanks anyway :)