In the UIView
, docs, it is stated that you must override requiresConstraintBasedLayout
to return true
in your custom view if if needs constraints to work.
How do you do this using Swift 3?
Use the following syntax for overriding the getter:
override open class var requiresConstraintBasedLayout: Bool {
get {
return true
}
}
To override the requiresConstraintBasedLayout
getter you can simply use:
override open class var requiresConstraintBasedLayout: Bool {
return true
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With