iOS/MacOS Tricks to Debug/Detecting Ambiguous Auto Layouts Issues
This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.
This time I will bring you some tricks directly from Apple’s document regarding the ways to debug / detecting ambiguous warning (⚠️) for Auto Layouts in iOS and MacOS.
To kick things off, I do want mention that Ambiguous Warning for Auto Layout means that the configuration you add into your storyboard or xib file has no conflicts (otherwise it will show ❗️in storyboard). However, it has multiple ways to fulfill your auto layout, so that the system will randomly choose a fine solution to render your view, which maybe correct, maybe wrong, in other words, very inconsistent.
“There are a few methods you can call to help identify ambiguous layouts. All of these methods should be used only for debugging. Set a breakpoint somewhere where you can access the view hierarchy, and then call one of the following methods fr