Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created February 6, 2021 22:21
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/d5052b0fe062af645c954dc5e88365cc to your computer and use it in GitHub Desktop.
Save sturdysturge/d5052b0fe062af645c954dc5e88365cc to your computer and use it in GitHub Desktop.
import SwiftUI
struct ContentView: View {
@StateObject var dataModel = DataModel.shared
var body: some View {
VStack {
Text(String(format: "%.f", dataModel.speed))
.font(.system(size: 400))
.minimumScaleFactor(0.2)
.frame(maxWidth: .infinity, maxHeight: .infinity)
Toggle("KPH", isOn: $dataModel.isKPH)
.frame(width: 150)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment