Custom Keyboard Font Error

260 Views Asked by At

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

1

There are 1 best solutions below

0
On BEST ANSWER

You have to access the label inside your button. Like this -

self.testingKeyboard.titleLabel?.font = UIFont(name: "HelveticaNeue-UltraLight", size: 50.0);