ZBJCalendar是一个简单的日历iOS的框架

网友投稿 680 2022-10-25 15:56:16

ZBJCalendar是一个简单的日历iOS的框架

ZBJCalendar is a simple way to create a calendar view. The concept of ZBJCalendar is UICollectionView or UITableView.

As we know, UICollectionView and UITableView set up the corresponding relations between cell and indexPath. Differently, ZBJCalendar set up the corresponding relations between cell and date, this is important to understand ZBJCalendar.

Requirements

iOS7 or later

Installation with CocoaPods

pod 'ZBJCalendar'

Installation with Carthage

github "wanggang316/ZBJCalendar"

Architecture

ZBJCalendarView

This is the main class of ZBJCalendar, an instance of this is a calendar view.

You can find some familiar properties and new properties:

dataSource is protocol property which used to custom cells or headersdelegate is protocol property which used to handle the display and behaviour of the day cells.firstDate and lastDate use to set the calendar's start date and end date.selectionMode is a enum of ZBJSelectionMode which express the single selection or mutable selection or can't be select.

Also, it contains some familiar methods like:

- (void)registerCellClass:(id)clazz withReuseIdentifier:(NSString *)identifier;- (void)reloadData;- (id)cellAtDate:(NSDate *)date;- (void)reloadCellsAtDates:(NSSet *)dates;

A protocol to custom the cell data model object. It supplies the cell and supplementary view's information about appearance and data.

- (void)calendarView:(ZBJCalendarView *)calendarView configureCell:(id)cell forDate:(NSDate *)date;- (void)calendarView:(ZBJCalendarView *)calendarView configureSectionHeaderView:(id)headerView firstDateOfMonth:(NSDate *)firstDateOfMonth;- (void)calendarView:(ZBJCalendarView *)calendarView configureSectionFooterView:(id)headerView lastDateOfMonth:(NSDate *)lastDateOfMonth;- (void)calendarView:(ZBJCalendarView *)calendarView configureWeekDayLabel:(UILabel *)dayLabel atWeekDay:(NSInteger)weekDay;

A protocol use to handle the display and behaviour of ZBJCalendar.

- (BOOL)calendarView:(ZBJCalendarView *)calendarView shouldSelectDate:(NSDate *)date;- (void)calendarView:(ZBJCalendarView *)calendarView didSelectDate:(NSDate *)date ofCell:(id)cell;

ZBJCalendarWeekView

ZBJCalendar provider a week view by this class, you can change it's style by implement

NSDate+ZBJAddition

This category provide utility methods for NSDate.

NSDate+IndexPath

This category provide methods used to corresponding relations between indexpath and date.

Examples

License

ZBJCalendar is released under the MIT license.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:webpack 核心 Compiler 实现(系列一)
下一篇:数字化的一切都会在安全沙箱里面,企业如何数字化转型?
相关文章