mrsunx / Lunar-iOS

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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];

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.33.5"))

License

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

About

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

License:MIT License


Languages

Language:Swift 99.7%Language:Ruby 0.3%