Latest 1.0.5
Homepage https://github.com/xiaozhuxiong121/PGActionSheetCalendar
License MIT
Platforms ios 8.0, requires ARC
Dependencies FSCalendar
Frameworks UIKit
Authors

PGActionSheetCalendar

使用FSCalendar进行封装的

CocoaPods安装

pod 'PGActionSheetCalendar'

使用

let calendar = PGActionSheetCalendar()
present(calendar, animated: false, completion: nil)

高级用法

有两种监听选中日期的方法

1、代理

calendar.delegate = self

func calendar(_ calendar: PGActionSheetCalendar, didSelectDate components: DateComponents) {
    print("year = ", components.year!,"month = ", components.month!,  "day = ", components.day!)
}

2、闭包

calendar.didSelectDateComponents = {components in
    print("year = ", components.year!,"month = ", components.month!,  "day = ", components.day!)
}

设置title

let label = calendar.titleLabel
label.text = "PGCalendar"

设置按钮的样式

calendar.cancelButton.setTitleColor(UIColor.red, for: .normal)
calendar.sureButton.setTitleColor(UIColor.red, for: .normal)

设置日历的样式

https://github.com/WenchaoD/FSCalendar

Latest podspec

{
    "name": "PGActionSheetCalendar",
    "version": "1.0.5",
    "summary": "PGActionSheetCalendar",
    "homepage": "https://github.com/xiaozhuxiong121/PGActionSheetCalendar",
    "license": "MIT",
    "authors": {
        "piggybear": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/xiaozhuxiong121/PGActionSheetCalendar.git",
        "tag": "1.0.5"
    },
    "source_files": [
        "PGActionSheetCalendar",
        "PGActionSheetCalendar/**/*.swift"
    ],
    "frameworks": "UIKit",
    "requires_arc": true,
    "dependencies": {
        "FSCalendar": []
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This