How come for a dynamic font on a UILabel
where we have the following:
artistLabel.font = UIFont.preferredFont(forTextStyle: .body, compatibleWith: UITraitCollection(legibilityWeight: .regular))
artistLabel.adjustsFontForContentSizeCategory = true
trackLabel.font = UIFont.preferredFont(forTextStyle: .body, compatibleWith: UITraitCollection(legibilityWeight: .bold))
trackLabel.adjustsFontForContentSizeCategory = true
bold and regular look the same? How can I get a true "bold" font?
You can use a custom font for this.
Step 1: Add Custom fonts to the project.
Step 2: Add these fonts under "Fonts Provided by application" key in info.plist file
Step 3: Use it as below.
For Bold font:
artistLabel.font = UIFont(name:"ArchSans-Bold", size: fontSize)
For Regular Font:
artistLabel.font = UIFont(name:"ArchSans", size: fontSize)