触点数字孪生,揭秘它的独特魅力
680
2022-10-25
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
Also, it contains some familiar methods like:
- (void)registerCellClass:(id)clazz withReuseIdentifier:(NSString *)identifier;- (void)reloadData;- (id)cellAtDate:(NSDate *)date;- (void)reloadCellsAtDates:(NSSet
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小时内删除侵权内容。