-
-
Save laevandus/be02c83927bbc6eca36f824c5550b407 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 ContentView: View { | |
@StateObject var viewModel = ViewModel() | |
var body: some View { | |
NavigationView { | |
Form { | |
Section { | |
// … | |
DateDurationPicker( | |
selection: $viewModel.selection, | |
values: Array(1..<100), | |
units: DateDuration.Unit.allCases | |
) | |
// … | |
} | |
} | |
.navigationTitle("Reminders") | |
} | |
} | |
} | |
extension ContentView { | |
final class ViewModel: ObservableObject { | |
@Published var selection = DateDuration(value: 1, unit: .days) | |
// … | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment