Slide 47
Slide 47 text
private func setup() {
label = UILabel()
label.text = "Section Header"
label.font = UIFont.boldSystemFont(ofSize: 15)
label.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(label)
let guide = contentView.readableContentGuide
NSLayoutConstraint.activate([
label.topAnchor.constraint(equalTo: guide.topAnchor),
label.bottomAnchor.constraint(equalTo: guide.bottomAnchor),
label.leadingAnchor.constraint(equalTo: guide.leadingAnchor),
label.trailingAnchor.constraint(equalTo: guide.trailingAnchor),
])
}