Skip to content

KimWooHyun/WHLunarCalendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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, dngus242@gmail.com

License

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

About

A swift library for lunar calendar.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors