var soundPoolLabel: UILabel {
let label = UILabel(frame: CGRect(x: 20, y: 90, width: 540, height: 94))
label.text = "SoundPool"
label.textColor = UIColor.black
label.font = UIFont(name: "Bodoni 72 Oldstyle", size: 80)
let attributedString = NSMutableAttributedString(string: label.text!)
attributedString.addAttribute(kCTKernAttributeName as NSAttributedStringKey, value: CGFloat(1.0), range: NSRange(location: 0, length: attributedString.length))
label.attributedText = attributedString
return label
}
soundPoolLabel.translatesAutoresizingMaskIntoConstraints = false
let topConstraint = soundPoolLabel.topAnchor.constraint(equalTo: view.topAnchor, constant: 90)
NSLayoutConstraint.activate([topConstraint])
Run Code Online (Sandbox Code Playgroud)