Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created January 4, 2021 20:31
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/df56dbd56ebe62ce208a622c9fe6c7c8 to your computer and use it in GitHub Desktop.
Save sturdysturge/df56dbd56ebe62ce208a622c9fe6c7c8 to your computer and use it in GitHub Desktop.
struct FontWeightPicker: View {
@Binding var fontWeight: WeightType
var body: some View {
Group {
Text("Font weight")
.frame(maxWidth: .infinity, alignment: .leading)
Picker(selection: $fontWeight, label: EmptyView()) {
ForEach(WeightType.allCases, id: \.self) { fontWeight in
Text(fontWeight.rawValue)
}
}
.frame(height: 150)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment