Lesson 1 Flashcards
SwiftUI Intro
what is SwiftUI
tool we use to build apps
3 pros of SwiftUI
- displays views on screen
- handle user interaction
- manage state and data flow
Xcode: app struct
main entry point of app in xcode
Xcode ContentView
represents UI of app in xcode
Xcode assets
catalog of images, colors, files, etc to use in app
Xcode .xcodeproj
metadata about app
ContentView Tour: import SwiftUI
imports app development tools (types, etc) that we can use
ContentView Tour: ContentView
view - struct that conforms to view –> can be displayed
ContentView Tour:
var body : some View {…}
view protocol requirement –> what this view displays
Preview {…}
enables interactive reloading previews –> iPhone display
HStack {..}
arranges elements in order from left to right (leading to trailing)
VStack{…}
arranges elements in order from top to bottom
2 parameters of HStack and VStack
- alignment
- spacing