Added support for Date Picker Ranges in Skip Lite#352
Added support for Date Picker Ranges in Skip Lite#352marcprux merged 3 commits intoskiptools:mainfrom
Conversation
marcprux
left a comment
There was a problem hiding this comment.
This looks like a great addition! It'd be doubly-great if we could get SkipFuseUI support in https://github.com/skiptools/skip-fuse-ui/blob/main/Sources/SkipSwiftUI/Controls/DatePicker.swift for the new constructors 🙏
| public init(getSelection: @escaping () -> Date, setSelection: @escaping (Date) -> Void, bridgedDisplayedComponents: Int, bridgedLabel: any View) { | ||
| self.init(selection: Binding(get: getSelection, set: setSelection), displayedComponents: DatePickerComponents(rawValue: bridgedDisplayedComponents), label: { bridgedLabel }) | ||
| } | ||
| public init(selection: Binding<Date>, in range: ClosedRange<Date>, displayedComponents: DatePickerComponents = [.hourAndMinute, .date], @ViewBuilder label: () -> any View) { |
There was a problem hiding this comment.
We need // SKIP @bridge for all these constructors to get native support in SkipFuseUI.
There was a problem hiding this comment.
Thanks for pointing that out. I wasn't sure about that, because it seems like the constructors already exist in Skip Fuse: https://github.com/skiptools/skip-fuse-ui/blob/6ab2af03c675e1c748c5889032e6007e7ec215af/Sources/SkipSwiftUI/Controls/DatePicker.swift#L42.
That's why I haven't changed anything there yet. Or should they now be merged into Skip UI and then bridged? 😅
|
I'll get this in now and we can look into Fuse support in a future PR. |
This PR adds support for Date Picker Ranges for Skip Lite apps.
To try it out, you can check out the
DatePickerPlaygroundin Skip Showcase.Related PRs:
Thank you for contributing to the Skip project! Please review the contribution guide at https://skip.dev/docs/contributing/ for advice and guidance on making high-quality PRs.
Use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.
Skip Pull Request Checklist:
swift test