Home > Software design >  Is is possible to use an imported custom font for a button in swift UI ios app?
Is is possible to use an imported custom font for a button in swift UI ios app?

Time:12-17

I'm a beginner with swift and have reviewed login image

If it is possible, what should I replace the 8th line with?

CodePudding user response:

Make sure you add the fonts correctly to your project..

enter image description here

button.titleLabel?.font = UIFont(name: "Lovelo Black", size: size)

CodePudding user response:

In swiftUI you can use custom function from Font to initialise and use any custom fonts. have a look at bellow example code.

Font.custom("Lovelo_Black", size: 24)

Which generates bellow result

  • Related