I know this question has been asked before, and the question seemed to be solved, but I have an issue that I can't seem to solve. I'm trying to change to font of a UIButton using
advanceButton.titleLabel!.font = UIFont (name: "ArchitectsDaughter", size: 17)
However, when I use this I get a compile message that
(AnyObject) ->() Does not have a member named 'titleLabel'
I've tried both the implicit, normal, and optional types for titleLabel but nothing will fix this. Can someone help me please? Thanks in advance!
Your advanceButton is not of type UIButton.
When you define advanceButton make sure it is of type UIButton.
like so,
var advanceButton : UIButton = UIButton()
advanceButton.titleLabel!.font = UIFont(name: "Times New Roman", size: 25)
That looks like you either have a method named advanceButton that is colliding with a variable named advanceButton, or instead of defining an @IBOutlet for your button you defined an @IBAction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With