Button title and image not geting rendered. Works fine in iOS13 and below, but after updating to Xcode12.0.1 and iOS14, it is not working.
let viewAllButton: RoundedButton = {
let button = RoundedButton()
button.translatesAutoresizingMaskIntoConstraints = false
button.backgroundColor = .red
button.setTitle("View all", for: .normal)
button.setTitleColor(.white, for: .normal)
return button
}()
class RoundedButton: UIButton {
override func draw(_ rect: CGRect) {
super.draw(rect)
self.layer.cornerRadius = self.bounds.height / 2
self.layer.masksToBounds = true
}
}