Search code examples
xcodeautolayoutstoryboard

In the Xcode 13 size inspector Layout dropdown what does "Inferred (Autoresizing Mask) mean?


In the Xcode 13 size inspector Layout dropdown what does "Inferred (Autoresizing Mask) mean? I.e. what is the behavior of choosing it over simply Autoresizing Mask? A related aside, there is also a third choice "inferred constraints" that is sometimes present sometimes not present. It seems that with the Game app the behavior of dragging things like stack views into a view or duplicating stack views gives inconsistent behavior. I.e. the duplicated stack view gets different Layout choices.

Xcode 13 Size Inspector


Solution

  • If you choose Inferred, you allow Interface Builder to keep inferring. If you get this view involved with autolayout, it will infer Autolayout instead of Autoresizing.

    But if you choose Autoresizing, you override Interface Builder. If you involve this view with autolayout, the auto resizing values will be translated into constraints, and you'll have to know what you're doing or you'll get a constraint conflict.