Last updated 3 months ago
Was this helpful?
โฉ โฉ layout
SwiftUI layout system:
Parent proposes a size for child.
Child chooses its own size.
Parent places child in parentโs coordinate space.
SwiftUI views manage size in different ways:
"push-out" views: expand to fill space offered by parent. ๐, , ...
"pull-in" views: have ideal size that varies according to their contents. ๐ , container views (HStack, VStack , ...)
"fixed" views: have ideal size that never varies. ๐ or ...
.frame()
Adaptive Layout
Alignment
grids
Paul โฉ
objc.io โฉ
Thinking in SwiftUI, Ch. 4: Layout
Swift Talk โฉ
Majid โฉ
Sundell โฉ A guide to the SwiftUI layout system -
็ฅไน โฉ โฉ
Types for Layout โฉ
GeometryReader is often used to do custom layout.
PreferenceKey
Cannot convert value of type 'Self' to expected argument type 'Binding<C>' โ๏ธ error occurred when designing protocol for layout.
โฉ
โญ๏ธ
- used in , , and
Color
LinearGradient
Circle
Text
Toggle
DatePicker
List
Picker
Form