I know that to set a custom font of an element on the screen I can simply dosomeLabel.font=UIFont(name: "Exo 2.0", size: 15).
someLabel.font=UIFont(name: "Exo 2.0", size: 15)
I was wondering how one could set it for an entire app using swift. (A hack would be to do what I know for every single element of the app but that is just going to be a maintainability nightmare)
I see that this question has already been asked with an objective-C tag, How to set a custom font for entire iOS app without specifying size but I'm not familiar enough with objective-C enough to port the code to swift
You can set the appearance of the UILabel and other UIViews:
UILabel.appearance().font = UIFont(name: "yourFont", size: yourSize)
More General:
AnyUIView.appearance().font = UIFont(name: "yourFont", size: yourSize)
2.1m questions
2.1m answers
60 comments
57.0k users