The following code works fine on iOS 12, but on iOS 13.4.1, the variable is freed and It will crash."
The behavior of NSLayoutConstraint.deactivate has been changed. Is it?
Remove weak or NSLayoutConstraint.deactivate, the problem is gone. Which is appropriate in this case?
class ViewController: UIViewController {
@IBOutlet private weak var constraint: NSLayoutConstraint!
override func viewDidLoad() {
NSLayoutConstraint.deactivate([constraint])
constraint.constant = 100
NSLayoutConstraint.activate([constraint])
}
}