-
-
Save laevandus/e71b26e43fa053ff21b3365bcb2dd9d2 to your computer and use it in GitHub Desktop.
This file contains 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
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