user7961001
user7961001

Reputation:

How to increase Font Size in button Pragmatically (swift3)

I would like the user to have the ability to make the text larger.

I have figured out how to increase a button overall size but the text remains the same.

button.frame =  CGRect(x: 100, y: 400, width: 100, height: 50)

How to increase Font Size in button Pragmatically in swift3?

Upvotes: 0

Views: 1345

Answers (1)

ThiagoAM
ThiagoAM

Reputation: 1542

Use titleLabel, like this:

let button = UIButton()
button.titleLabel?.font = UIFont.systemFont(ofSize: 30)

You can use UIFont in a lot of ways, check it's constructor!

Upvotes: 2

Related Questions