Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created June 21, 2023 09:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/c3b3822052c5a4da5ff522a92e78e981 to your computer and use it in GitHub Desktop.
Save laevandus/c3b3822052c5a4da5ff522a92e78e981 to your computer and use it in GitHub Desktop.
struct CollapsibleWheelPicker<SelectionValue, Content, Label>: View where SelectionValue: Hashable, Content: View, Label: View {
@Binding var selection: SelectionValue
@ViewBuilder let content: () -> Content
@ViewBuilder let label: () -> Label
var body: some View {
CollapsibleView(label: label) {
Picker(selection: $selection, content: content) {
EmptyView()
}
.pickerStyle(.wheel)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment