Last active
March 14, 2021 09:11
-
-
Save waterlou/f5b1c6699720e89ff21a62c0ebfa308c to your computer and use it in GitHub Desktop.
001-stockpriceview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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