WHLunarCalendar 0.1.5

WHLunarCalendar 0.1.5

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Oct 2019
SPMSupports SPM

Maintained by KimWooHyun.



  • By
  • kimwoohyun

WHLunarCalendar

Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

WHLunarCalendar is available through CocoaPods. To install it, simply add the following line to your Podfile:

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

Usage - Use storyboard

  1. Add UIView

image

  1. Add custom class

image

  1. Import WHLunarCalendar & add delegate
ViewController.swift

import UIKit
import WHLunarCalendar

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

    override func viewDidLoad() {
        super.viewDidLoad()
        self.lunarCalendar.delegate = self
    }
}
  1. Add event
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
    }
}

Author

kimwoohyun, [email protected]

License

WHLunarCalendar is available under the MIT license. See the LICENSE file for more info.