swiftcode / Pool

3 stars 1 forks source link

How to change font #4

Open swiftcode opened 3 years ago

swiftcode commented 3 years ago

To change the font size, check out the label.font line. There are options other than title1.

Here's documentation on the options available: https://developer.apple.com/documentation/uikit/uifont/textstyle Here's documentation on UIFont itself: https://developer.apple.com/documentation/uikit/uifont/1619030-preferredfont

    var week: UILabel = {
        let label = UILabel(frame: .zero)
        label.translatesAutoresizingMaskIntoConstraints = false
        label.text = "Week"
        label.textColor = .black
        label.font = UIFont.preferredFont(forTextStyle: .title1)
        return label
    }()