Created
April 20, 2021 14:36
-
-
Save trilliwon/94acc585fef90c666d2a80a032097677 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// | |
// ContentView.swift | |
// WatchOS Extension | |
// | |
// Created by won on 2021/04/18. | |
// | |
import SwiftUI | |
struct ContentView: View { | |
var station: Station = .sample | |
let gradient = Gradient(colors: [ | |
Color("category0"), | |
Color("category1"), | |
Color("category2"), | |
Color("category3"), | |
Color("category4") | |
]) | |
var body: some View { | |
ZStack { | |
Gauge( | |
value: 0.05, | |
in: 0...1, | |
label: { | |
Text("나쁨") | |
}, | |
currentValueLabel: { Text("😆") }, | |
markedValueLabels: { | |
Text("0%").tag(0.0) | |
Text("50%").tag(0.5) | |
Text("100%").tag(1.0) | |
}) | |
.gaugeStyle(CircularGaugeStyle(tint: gradient)) | |
} | |
.ignoresSafeArea() | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment