I made the mistake up updating my project to Swift 4.2 without waiting for pods to be updated. I have slowly updated all of my code, but there's one line that I can't seem to figure out.
var animationRect = UIEdgeInsetsInsetRect(frame, UIEdgeInsets(top: padding, left: padding, bottom: padding, right: padding))
The error I receive is,
UIEdgeInsetsInsetRect' has been replaced by instance method 'CGRect.inset(by:)
Any help with this would be greatly appreciated!
The error it is pretty self explanatory. You can use it like this:
var animationRect = frame.inset(by: UIEdgeInsets(top: padding, left: padding, bottom: padding, right: padding))
or simply
var animationRect = frame.insetBy(dx: padding, dy: padding)
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