How do I rewrite the code below?
self.view.frame = CGRectOffset(self.view.frame, 0, movement)
'Offset' has been replaced by 'offsetby'
When I replaced it with the so called "solution":
self.view.frame = CGRect.offsetby(self.view.frame, 0, movement)
I receive an error:
"Instance member 'offsetBy' cannot be used on type 'CGRect'; did you mean to use a value of this type instead?"
You have to call offsetBy
on an instance of a CGRect
.
self.view.frame = self.view.frame.offsetBy(dx: 0, dy: movement)
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