Latest 0.0.1
Homepage https://github.com/Yanyinghenmei/ZYCalendarView
License MIT
Platforms ios 8.0, requires ARC
Authors

image

参考JTCalendar, 模仿Airbnb的日历

Reference JTCalendar, imitate Airbnb’s calendar

How to use

Download ZYCalendarView and try out the included you iPhone project or use CocoaPods.

Podfile

To integrate ZYCalendarView into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

target 'TargetName' do
pod 'ZYCalendarView', '~> 0.0.1'
end

Then, run the following command:

$ pod install

Simple code

#import <ZYCalendarView.h>
    ZYCalendarView *view = [[ZYCalendarView alloc] initWithFrame:CGRectMake
                           (0, 64, self.view.frame.size.width, self.view.frame.size.height-64)];

    // 不可以点击已经过去的日期
    view.manager.canSelectPastDays = false;
    // 可以选择时间段
    view.manager.selectionType = ZYCalendarSelectionTypeRange;
    // 设置当前日期
    view.date = [NSDate date];

    view.dayViewBlock = ^(ZYCalendarManager *manager, NSDate *dayDate) {
        // NSLog(@"%@", dayDate);
        for (NSDate *date in manager.selectedDateArray) {
            NSLog(@"%@", [manager.dateFormatter stringFromDate:date]);
        }
        printf("n");
    };

Latest podspec

{
    "name": "ZYCalendarView",
    "version": "0.0.1",
    "summary": "Imitate Airbnb's calendar.",
    "description": "u6a21u4effAirbnbu7684u65e5u5386, u6709u5355u9009u3001u591au9009u548cu8303u56f4u9009u62e9u4e09u79cdu6a21u5f0f",
    "homepage": "https://github.com/Yanyinghenmei/ZYCalendarView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Yanyinghenmei": "1113135372@qq.om"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/Yanyinghenmei/ZYCalendarView.git",
        "tag": "0.0.1"
    },
    "source_files": [
        "ZYCalendarView",
        "ZYCalendarView/**/*.{h,m}"
    ],
    "resources": "ZYCalendarView/Images/*.png",
    "requires_arc": true
}

Pin It on Pinterest

Share This