<aside> 📆 Feb 01, 2020 - Mar 01, 2020
</aside>
Process Goal: Learn SwiftUI
Outcome Goal: Build an app using SwiftUI that includes interaction design
Created: Simple Counter Functionality
Read & write variable
@State private var name = ""
TextField("Name is \\($name)") // read & write
Text("Name is \\(name)") // read
Picker
Whether picker goes to new view or in current view depends
Picker(selection: $selectedOption, label: Text("Title")) {}
Create Form
Section(header: Text("Title") {}
HStack
, VStack
, ZStack
Created: Gradient Generator
Gradients
LinearGradient(gradient: Gradient(colors: [.white, .black]), startPoint: .top, endPoint: .bottom)
RadialGradient(gradient: Gradient(colors: [.blue, .black]), center: .center, startRadius: 20, endRadius: 200)
AngularGradient(gradient: Gradient(colors: [.red, .yellow, .green, .blue, .purple, .red]), center: .center)
Image inside button
Show Alert
@State private var showingAlert = false
Button("Title"){self.showingAlert.true}.alert(isPresented: $showingAlert){Alert(...)}
shuffled()
randomize array orderInt.random(in:)
chooses one random integer in a range we specify.NavigationLink(destination: ViewName()) {}
go to other viewsDay 16: SwiftUI Card Flip Animation
Create: rock, paper, scissor game
ForEach can identify string value directly as index
ForEach(agents, id: \\.self) {}
Custom binding