Skip to content

Instantly share code, notes, and snippets.

@waterlou
Last active March 14, 2021 09:11
Show Gist options
  • Save waterlou/f5b1c6699720e89ff21a62c0ebfa308c to your computer and use it in GitHub Desktop.
Save waterlou/f5b1c6699720e89ff21a62c0ebfa308c to your computer and use it in GitHub Desktop.
001-stockpriceview
struct ContentView: View {
@State var price: Double = 100.0
var body: some View {
VStack(spacing: 16) {
StockPriceText(price: self.price).font(.title)
HStack {
Button("Down") {
price = price - 1
}
Button("Up") {
price = price + 1
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment