Open pipelineoptika opened 6 years ago
Thanks for raising this issue. I was under the impression that constraints that have been translated from autoresizing masks have an additional piece of info in their description, in the form h=--& v=--&
. E.g.:
"<NSAutoresizingMaskLayoutConstraint:0x60000089a130 h=--& v=--& UIView:0x7f95000e5ac0.width == 70 (active)>"
Currently any descriptions that include this info are determined to have been translated from autoresizing masks, regardless of whether they have an identifier with the prefix UIView-Encapsulated-Layout-
.
The documentation seems to confirm this. Are you seeing NSAutoresizingMaskLayoutConstraint
s printed without the h=--& v=--&
info?
Not as such - what I'm seeing is this:
"<NSLayoutConstraint:0x11a9ade60 'UIView-Encapsulated-Layout-Width' Document Base.width == 1366 (active, names: Document Base:0x1192fbcf0 )>"
, where Document Base
is just the accessibilityIdentifier
.
The main thing to note is that I have no table or collection views in the hierarchy, but I did have autoresizing masks that needed to be removed.
I don't know if this helps?
This is as at iOS 11, which appears to make some changes in this area. This post suggested it, and it seems reasonable based on what finally fixed my layout issue (which was correctly dealing with those masks).
@pipelineoptika Thanks very much for the additional info; I will have a deeper look. Just to check, are you using any Auto Layout frameworks such as SnapKit in that project?
No, none - it's just vanilla XIBs.
By the way - thank you so much for this tool. It's helped us greatly! ❤️
UIView-Encapsulated-Layout-*
constraints are commonly added by collection views et al, but are also the resultant constraints fromtranslatesAutoresizingMaskIntoConstraints
. In projects where constraints are being added to old frame-based layouts, knowing this can be really helpful.