I'm trying to convert a Objective-C app to Swift but I'm stuck with setBounds. The original code looks like this:
- (void)setBounds:(CGRect)bounds {
[super setBounds:bounds];
// code
}
What is the equivalent in Swift? I've tried looking in the documents and google but can't seem to figure it out.
You need to override bounds:
override var bounds: CGRect{
didSet{
//your code here
}
}
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