You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,7 @@ Extremely Fast views layouting without auto layout. No magic, pure code, full co
72
72
*[safeArea, readable and layout margins](#safeAreaInsets)
73
73
*[WrapContent](#wrapContent)
74
74
*[justify, align](#justify_align)
75
+
*[Automatic sizing](#automatic_sizing)
75
76
*[UIView's transforms](#uiview_transform)
76
77
*[Warnings](#warnings)
77
78
*[Animations using PinLayout](#animations)
@@ -1477,7 +1478,7 @@ This example centered horizontally the view B in the space remaining at the righ
1477
1478
1478
1479
<br/>
1479
1480
1480
-
<aname="justify_align"></a>
1481
+
<aname="automatic_sizing"></a>
1481
1482
## Automatic Sizing
1482
1483
Sizing views as part of the manual layout process is made with `sizeThatFits(_ size: CGSize)` where a view returns its ideal size given his parent size. Implementing sizing code has always been cumbersome because you always end up writing the same code twice, a first time for the layout and the second time for sizing. Sizing usually use the same rules layout does but implemented slightly differently because no subview `frame` should be mutated during sizing. Since `PinLayout` already takes care of the layout, it makes perfect sense to leverage it's layout engine to compute sizing.
1483
1484
@@ -1504,20 +1505,20 @@ Sizing views as part of the manual layout process is made with `sizeThatFits(_ s
0 commit comments