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!
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 trial

Junaid Abd
Courses Plus Student 32 PointsHow to Change text font UITextView- Text loaded from array?
I have a UITextView, the text is loaded from an array into the textView when th app is loaded. How can I change the font, colour and size of the text?
Language-Swift

Junaid Abd
Courses Plus Student 32 PointsHey, When the view loads, the elements in the array are loaded into the textView, I want the text to be the font I chose. So basically when the text loads it must be a different font, size and colour.
2 Answers

Steve Hunter
57,710 PointsYou can change the font size, color etc in the attributes inspector when you sepect your storyboard.
Steve.

Junaid Abd
Courses Plus Student 32 Pointsi did that, but when the text loads from the string it appears in the default size, colour and font.

Steve Hunter
57,710 PointsYou can also amend the properties programatically.
var font: UIFont!
var textColor: UIColor!
I'll have a mess about with these to see if I can get them to work.
Steve.
Steve Hunter
57,710 PointsSteve Hunter
57,710 PointsHiya!
How do you want to change these properties? In response to an event, such as a button click?
Steve.