Answer the question
In order to leave comments, you need to log in
How to access layer properties of UIControl subclasses in iOS 13/XCode 11 using UIKIt?
Faced the following situation: There is a simple button (UIButton) which should have borders (borderWidth/borderColor). Previously, this could be done by creating your own class with inheritance from UIButton.
For example:
class BorderButton: UIButton {
override class func awakeFromNib() {
super.awakeFromNib()
layer.borderWidth = 3.0
layer.borderColor = UIColor.white.cgColor
}
}
Instance member 'layer' cannot be used on type 'BorderButton'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question