Reputation: 11
I tried to build a textView with two buttons to in/decrease the size of the text. I used:
textView.font = UIFont(name: "System", size: 50)
But no matter which number I set for the size, the text always becomes the same size (around 11) when calling the method.
Why is that? Could you help me with that?
Upvotes: 1
Views: 734
Reputation:
If you would like to do something you said, you can make your own category like this:
extension UITextView {
func increaseFontSize () {
self.font = UIFont(name: self.font!.fontName, size: self.font!.pointSize+4)!
}
}
To use it just import it like this:
textview.increaseFontSize()
This will increase your text by 4.
Upvotes: 2