Giter Site home page Giter Site logo

zbjcalendar's Introduction

ZBJCalendar GitHub license Cocoapods Codewake

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 <ZBJCalendarDataSource> protocol property which used to custom cells or headers
  • delegate is <ZBJCalendarDelegate> 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<NSDate *> *)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

show

License

ZBJCalendar is released under the MIT license.

zbjcalendar's People

Contributors

wanggang316 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zbjcalendar's Issues

如何添加节假日的信息?

你好,最近项目有需求用到日历,偶然间发现你的这个框架做的很好,但是我有个小需求就是加个节假日信息,不知可否?

Set default start and end date

Hi guys,

I need to be select start and end date default in the calendar without didselect function.
The objective of this function is i want to maintain user's previous selected date session.

有一个bug

在选择最少住一天的情况下,已租的日期还是可以选择,而设置最少住两天,就没有这种情况

Dependency "ZBJCalendar" has no shared framework schemes for any of the platforms: iOS

On running 'carthage update --platform iOS' , i am getting the error as

*** Fetching ZBJCalendar
*** Checking out ZBJCalendar at "0.0.9"
*** xcodebuild output can be found in /var/folders/y7/hmn36kf92mxdccyp7n9wc3_00000gp/T/carthage-xcodebuild.YHmxlp.log
*** Skipped building ZBJCalendar due to the error:
Dependency "ZBJCalendar" has no shared framework schemes for any of the platforms: iOS

If you believe this to be an error, please file an issue with the maintainers at https://github.com/wanggang316/ZBJCalendar/issues/new

Please advise how to resolve this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.