Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created February 8, 2021 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sturdysturge/d813db9bc7800f88dcbb03bcd3ce053d to your computer and use it in GitHub Desktop.
Save sturdysturge/d813db9bc7800f88dcbb03bcd3ce053d to your computer and use it in GitHub Desktop.
struct TickerTextView: View {
let ticker: Ticker
var body: some View {
Group {
Text(ticker.market.name)
Text("""
\(ticker.base.rawValue) <-> \(ticker.target)
\(ticker.last)
""")
.font(.largeTitle)
.multilineTextAlignment(.center)
Text("Volume: \(ticker.volume)")
}
}
}
struct RefreshView: View {
@EnvironmentObject var dataModel: DataModel
var body: some View {
Group {
Button("↻ Refresh", action: dataModel.refresh)
Text(dataModel.lastRefreshed)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment