UIFont in iOS

Mr.Javed Multani
1 min readOct 2, 2020

UIFont is a class that is used for getting and setting font-related information. It inherits from NSObject and conforms to Hashable, Equatable, CVarArg and NSCopying.

Declaring and initializing UIFont

You can declare a UIFont as follows:

var font: UIFont!

UIFont has more init() methods:

UIFont.init(descriptor: UIFontDescriptor, size: CGFloat) UIFont.init(name: String, size: CGFloat)

Therefore, you can initialize a UIFont like this:

let font =…

--

--

Mr.Javed Multani

Software Engineer | Certified ScrumMaster® (CSM) | UX Researcher | Youtuber | Tech Writer