Open MosheBerman opened 9 years ago
This feature request is essentially asking for the behavioral change implemented in iOS 7.
Same issue I am also getting, Did not understand your solution.
There's no solution yet. It's a feature request. ;-)
Related #120
Related: #97
selectedDate
would be added to the calendar view model.Defining the date
property as "selected date" and the new date used for display of a different time range as "visible date," here's a chart of user interaction to change the two values:
Legacy Behavior | New Behavior | |
---|---|---|
Change Visible Date | Single Tap | Tap Arrows or Scrub |
Change Selected Date | Single Tap | Tap Cell |
There are three options for the new behavior:
The third is a more complete description of the third, and that's the behavior modeled in the chart. I'm going to give that a go.
Some random thoughts:
UICollectionViewLayout
a little bit as well. touchesBegan:
and friends, but as a UIGestureRecognizer
it would be easier to implement scrolling.Thinking about this some more, it looks like we also need to worry about minimum/maximum dates, and delegate callbacks.
If the view model's current "date
" property is treated as "visibleDate
" and the new property is "selectedDate
" we need to decide if we duplicate the delegate methods for "visibleDate
" and "selectedDate
", and if not, which one fires when?
I think for now it might make sense to treat the "date
" as "selectedDate
" and add a "visibleDate
" property, so as to keep the delegate and minimum/maximum dates the same. This means that there's no way to tell when the user changes the visible date, and no way to clamp the visible months independently of clamping the selectable date range.
I think I need to think on this a little more.
Per, @snadahalli, in my words:
If you tap on one of the arrows on the calendar, it shows another month, and changes the selected date to the first of the newly visible month.
This behavior should remain enabled by default, but an optional alternative is to allow users of the library to set a flag which would allow users of the calendar to traverse the months without changing the date.