When compiling my iOS project in Xcode 10 (Swift 4.2), I get the following warning:
Instance will be immediately deallocated because property 'cropConstraint' is 'weak'.
The constraint is declared as:
@IBOutlet weak var cropConstraint: NSLayoutConstraint!
and used as:
cropConstraint = NSLayoutConstraint(
item: noCropButton,
attribute: .width,
relatedBy: .equal,
toItem: noCropButton,
attribute: .height,
multiplier: 1,
constant: 0
)
I checked that my outlet is connected properly.
What am I doing wrong here? Did something change in Xcode 10 that I missed.
Thanks.