You do not need to force the titleLabel to deploy to set it.
myButton.titleLabel?.font = UIFont(name: YourfontName, size: 20)
Since you are not using titleLabel here, you can just use it, and if it is zero, it will be just no-op.
I will also add, as other people say, the font property is deprecated and remember to use setTitle:forControlState: when setting the title text.
teradyl Mar 11 '16 at 19:34 2016-03-11 19:34
source share