The constraint in question is defined as:
@IBOutlet var heightConstraint: NSLayoutConstraint!
The function that is failing is setting the constant to 300 as follows:
private func changeHeight() { ... self.heightConstraint.constant = 300 //Unexpectedly found nil here}
It crashes only on the iPad when you double click the home button and the app is "minimized" into a small window. Has anyone else ever ran into this issue? Does not seem to crash on iPhone 8 or iPhone 6s so only when the home button is double clicked on the iPad. Solutions I've seen is to make sure the constraint is a strong constraint which it already is so at this point I'm very stuck. If anyone can give an insight into this crash it would be hugely appreciated. Thank you.
EDIT:
Additional info that might be useful. The constraint in question is the height constraint of a stack view if that matters.