Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created February 5, 2022 00:46
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 laevandus/e71b26e43fa053ff21b3365bcb2dd9d2 to your computer and use it in GitHub Desktop.
Save laevandus/e71b26e43fa053ff21b3365bcb2dd9d2 to your computer and use it in GitHub Desktop.
struct DateDurationPicker: UIViewRepresentable {
let selection: Binding<DateDuration>
let values: [Int]
let units: [DateDuration.Unit]
func makeUIView(context: Context) -> UIPickerView {
let pickerView = UIPickerView(frame: .zero)
pickerView.translatesAutoresizingMaskIntoConstraints = false
pickerView.delegate = context.coordinator
pickerView.dataSource = context.coordinator
return pickerView
}
// …
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment