Lesson 2 Flashcards
Intro to modifiers
Parameters: VStack Alignment types
1) .leading
2) .trailing
3) .center
Parameters: HStack Alignment types
1) .top
2) .bottom
3) .center
what does the VStack alignment types do?
changes the horizontal alignment of subviews
what does the HStack alignment types do?
changes the vertical alignment of subviews
Parameter: Spacing
changes the amount of space between elements
Spacer()
allows elements to grow apart (tall or wide depending on stack) the max amount they can
does modifier order matter?
YES
View modifiers
.background(), .padding() –> modifiers that change the whole view, wrap the applied view with modification
how are view modifiers implemented?
modifiers are implemented top to bottom, where each modifier is passed as an instance of the og view (modifying it each time) where once that modifier is applied it will be passed to the next one to build off of that view
Environment modifiers
.font(), .fontWeight(), .foregroundStyle() –> modifiers that wrap around data and change a specific piece