Releases: richardtop/CalendarKit
Releases Β· richardtop/CalendarKit
Add userInfo in EventDescriptor
Fix issue #52
Move userInfo property to EventDescriptor
Add example how to use userInfo property to identify which event has been pressed
Fix auto scroll to first event
Ability to scroll to a specific time, fix events starting or ending on a different date
Decouple Events and EventViews
- Created an
EventDescriptor
protocol describing model forEventView
- Created an
Event
class conforming toEventDescriptor
protocol
This class contains algorithm by which all the colors inEventView
are calculated.
If other algorithm is needed to calculate colors, a new class conforming toEventDescriptor
protocol could be created - Implemented View Reuse
Separating Model (EventDescriptor) from EventView will give two advantages:
- Possibility to improve internal parts of the library without changing the interface.
- (In the future) - possibility to register own custom classes for
EventView
, greatly improving customization.
and some smaller benefit:
Removing DynamicColor
dependency completely in the future.
If you're using this library, I'd like to hear your feedback. In most cases, very small changes needed - renaming:
- Change datasource protocol to
func eventsForDate(_ date: Date) -> [EventDescriptor]
- Setting formatted text as a
text
property instead ofdata: [String]
,
or subclassing anEvent
and providing an algorithm, how to calculatetext
fromdata
,
or implementing ownEventDescriptor
.
Scroll to first visible event, bugfixes
Expose day view scroll offset, expose ability to set timeline pan gesture's `require(toFail:)` method
- Expose day view scroll offset:
- Thought it might be useful to get the current scroll offset of the day view. In my case, I use it to determine if it's at the top and if it is, allow other gestures to work, i.e. expanding week/month header view.
- Ability to set timeline's pan gesture's
require(toFail:)
method
- Thought it might be useful to allow only certain gestures to work together. I.e. if another pan gesture has been detected, do not allow timeline to scroll. In my case, I use it expand/shrink the week/month header view and not scroll the day view at the same time.
By @v-ken
NSCopying for CalendarStyle, open access modifiers for delegates
Improvements by @v-ken
Thanks @v-ken !
Changes:
- BYO header view
- Allow hiding the built-in header view so that users can use their own header views
- Ability to set current date
- Expose function to set the current date in
DayView
- Maintain date order after a jump
- When jumping dates (by tapping on date in header view instead of swiping), the next swipe back jumps back to the previous date before the jump, instead of the previous date in the calendar. This fixes that issue.
- Long press in timeline view delegate callback
- Add delegate callback when the timeline view is long pressed in an area without any events
Relevant PR #33
New delegate methods & more customization for EventView
Exposed "date did change" delegate method via day view delegate
UserInfo object in EventView - possibility to store any custom model object to keep track of EventViews
By @danlozano
Added support for non-fullscreen DayView
Added support for non-fullscreen DayView by @diegorozen
Issue: #25
Pull Request #26