nighthawk / ASWeekSelectorView

iOS calendar-inspired simple mini week view to swipe through weeks and tap on days
Other
60 stars 12 forks source link

changes to allow highlighted dates and custom colors #2

Closed markGilchristBookingBug closed 8 years ago

markGilchristBookingBug commented 8 years ago

I have added the ability to have dates selected and have custom colors for date. I you want these changes in your base then please have them, if not reject this pull request. mark

nighthawk commented 8 years ago

This is great. Thank you and sorry for the slow reply!

nighthawk commented 8 years ago

Might change this down the track to use a delegate protocol though and ask for the selected dates on demand. That would better handle if there's potentially a large number of days to highlight (e.g., every day that has something on the user's calendar) or even an infinite number (e.g., every weekend).

nighthawk commented 8 years ago

I rewrote and ended up removing a fair bit of the code, and narrows down the main changes to a new delegate call titled:

/**
 Implement to change the color of the number for the specified date.
 @param date Date for which to customise color (not called for selected date)
 @return Color of number label, or `nil` to use default `numberTextColor`
 */
- (UIColor *)weekSelector:(ASWeekSelectorView *)weekSelector numberColorForDate:(NSDate *)date;

See commit: https://github.com/nighthawk/ASWeekSelectorView/commit/4f05d3a53b4aced3274276eaacfb73d42f5bd214