WHLunarCalendar 0.1.5

WHLunarCalendar 0.1.5

测试已测试
语言语言 SwiftSwift
许可 MIT
发布最新发布2019年10月
SPM支持SPM

Maintained by KimWooHyun.



  • kimwoohyun

WHLunarCalendar

Version License Platform

示例

要运行示例项目,请克隆仓库,然后首先从Example目录运行pod install

安装

WHLunarCalendar通过CocoaPods提供。要安装它,只需将以下行添加到您的Podfile中即可。

pod 'WHLunarCalendar', :git => 'https://github.com/KimWooHyun/WHLunarCalendar.git', :branch => 'master'

使用 - 使用Storyboard

  1. 添加UIView

image

  1. 添加自定义类

image

  1. 导入WHLunarCalendar & 添加代理
ViewController.swift

import UIKit
import WHLunarCalendar

class ViewController: UIViewController {
    @IBOutlet weak var lunarCalendar: WHLunarCalendar!

    override func viewDidLoad() {
        super.viewDidLoad()
        self.lunarCalendar.delegate = self
    }
}
  1. 添加事件
Extension

extension ViewController: LunarCalendarDelegate{
    func lunarCalendarCellClick(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        let cell = collectionView.cellForItem(at: indexPath) as! WHLunarCalendarCell
        print(cell.solorDay)
        print(cell.lunarDay)    // Optional
        print(cell.isLeap)      // Optional
    }
}

作者

kimwoohyun, [email protected]

许可协议

WHLunarCalendar 在MIT许可下可用。有关更多信息,请参阅LICENSE文件。