You don't need to force unwrap the titleLabel to set it.
myButton.titleLabel?.font = UIFont(name: YourfontName, size: 20)
Since you're not using the titleLabel here, you can just optionally use it and if it's nil it will just be a no-op.
I'll also add as other people are saying, the font property is deprecated, and make sure to use setTitle:forControlState:
when setting the title text.