Reputation: 7
I am using Xcode 6.1 and programming with swift and i was wondering if anyone new how to change the font for a custom keyboard app I am working on.
The code i was trying to use was ->
self.testingkeyboard.font = UIFont (name: "HelveticNeue-UltraLight", size 50);
And well when i run it i get an error of: 'font' is unavailable: APIs deprecated as of iOS7 and earlier are unavailable in Swift.
Do anyone know how to fix that error or at least to still change the font but without the error.
Here is a link to a picture of the error: error screenshot
Thnx, appswiftgb
Upvotes: 0
Views: 256
Reputation: 5683
You have to access the label inside your button. Like this -
self.testingKeyboard.titleLabel?.font = UIFont(name: "HelveticaNeue-UltraLight", size: 50.0);
Upvotes: 1