Skip to content

基于Lunar封装的iOS版本,支持Objective-C和Swift。

License

Notifications You must be signed in to change notification settings

HouHangLei/Lunar-iOS

Repository files navigation

Lunar-iOS

Version SPM LICENSE Platform iOSVersion

介绍

基于Lunar封装的iOS版本,支持Objective-CSwift

示例

对象初始化方法(例,阴历对象)

// Lunar
var d = Lunar.fromYmd(1986, 4, 21);
// Swift
var d = Lunar(year: 1986, month: 4, day: 21)
// OC
Lunar *d = [[Lunar alloc] initWithYear:1986 month:4 day:21];

调用方法(方法名和Lunar中一样)

// Lunar
var d = Lunar.fromYmd(1986, 4, 21);
d.toFullString()
// Swift
var d = Lunar(year: 1986, month: 4, day: 21)
d.toFullString()
// OC
Lunar *d = [[Lunar alloc] initWithYear:1986 month:4 day:21];
[d toFullString];

法定假日HolidayUtil

// Lunar
var holidays = HolidayUtil.getHolidays(2020);
console.log(holidays);
// Swift
var holidays = HolidayUtil.getHolidays(year: 2023)
print("\(holidays)")

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

Installation

CocoaPods

Add the following entry to your Podfile:

pod 'Lunar-iOS'

Swift Package Manager

To integrate using Apple's Swift package manager, add the following as a dependency to your Package.swift:

.package(url: "https://github.com/HouHangLei/Lunar-iOS.git", .upToNextMajor(from: "1.2.37.1"))

License

Lunar-iOS is available under the MIT license. See the LICENSE file for more info.

About

基于Lunar封装的iOS版本,支持Objective-C和Swift。

Resources

License

Stars

Watchers

Forks

Packages

No packages published