-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DateInlineRow, TimeInlineRow and DateTimeInlineRow style/rend… #2067
Conversation
…ering issues for iOS14.
Thank you! |
Source/Rows/DateInlineRow.swift
Outdated
onExpandInlineRow { cell, row, _ in | ||
onExpandInlineRow { cell, row, inlineRow in | ||
inlineRow.cellUpdate() { cell, row in | ||
cell.datePicker.datePickerMode = .date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think setting datePickerMode is not needed here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the documentation: default is UIDatePickerModeDateAndTime. So this line needs to stay for DateInlineRow and also the line that sets it to .time on the TimeInlineRow. But it looks like the line for DateTimeInlineRow that sets it to .dateAndTime can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean datePickerMode
is set in DatePickerCell
(line 54). It is not necessary to re-set it here
I agree with the change but I think |
@mats-claassen configureInlineRow takes DatePickerRowProtocol rather than DatePickerRow, which I need to be able to access the cell.datePicker. What if I add a new method to call from setupInlineRow that passes DatePickerRow? |
Sounds good. Then just don't call it in CountDown row |
…ering issues for iOS14. Update with changes from code review
…ering issues for iOS14. Revert onExpandInlineRow
@mats-claassen I have pushed an update |
…ering issues for iOS14. Change parameter on configurePickerStyle to DatePickerCell since the function is only changing the cell on the datePickerRow
Fix DateInlineRow, TimeInlineRow and DateTimeInlineRow style/rendering issues for iOS14. See screenshots from the Example app for details. The default picker view is .inline to match the iOS native apps. If a user is on iOS 13 or lower, they will still see the default style of wheels
DateInlineRow (before)
DateInlineRow (after)
TimeInlineRow (before)
TimeInlineRow (after)
DateTimeInlineRow (before)
DateTimeInlineRow (after)