Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the meaning of the Asterisk (*) in the output of [[UIWindow keyWindow] _autolayoutTrace]]

UIWindow has the private method _autolayoutTrace that helps you to find ambigous layouts. It's very nice and convenient and outputs something like this:

*<UIWindow:0x13436fd0> - AMBIGUOUS LAYOUT
|   *<UIView:0xd5e0b30>
|   |   *<PbJellyContentContainerView:0xd5e0ff0>
|   |   |   *<UIView:0x20710ee0>
|   |   |   |   *<PbMapContainerView:0x20710c90>
|   |   |   |   |   <MKMapView:0x2070df70>
|   |   |   |   |   |   <UIView:0xd1cca20>
|   |   |   |   |   |   |   <MKBasicMapView:0xd1cd020>
....

My question is not about any ambiguity. It is about the asterisk in front of some views. What is its meaning?

My guess would be that it marks all views that are using auto layout. But how does the system determine this?

Update:

It seems that the asterisk marks all views that either have at least one constraint set or that have a subview that has at least one constraint set.

Setting translatesAutoresizingMaskIntoConstraints to false without setting a constraint doesn't give the asterisk.

like image 490
Klaas Avatar asked Aug 29 '13 23:08

Klaas


1 Answers

This is the legend for -[UIView _autolayoutTrace] from WWDC 2015 session #219 video at 31:00

* - is laid out with auto layout
+ - is laid out manually, but is represented in the layout engine because translatesAutoresizingMaskIntoConstraints = YES
• - layout engine host
like image 78
Alexander Vasenin Avatar answered Oct 14 '22 07:10

Alexander Vasenin