Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7199

Swift - Unexpectedly found nil on a strong constraint when minimizing application on iPad

$
0
0

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.


Viewing all articles
Browse latest Browse all 7199

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>