Giter Site home page Giter Site logo

lunar-ios's Introduction

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.

lunar-ios's People

Contributors

avod-lit avatar houhanglei avatar

Stargazers

SoloX avatar  avatar HH思無邪 avatar MelodyJerry avatar heliang avatar daizi avatar mrxuan avatar 泽熙 avatar  avatar 大嘴 avatar Yuanxu Han avatar PainTypeZ avatar  avatar  avatar  avatar  avatar  avatar

Watchers

大嘴 avatar James Cloos avatar 泽熙 avatar  avatar

lunar-ios's Issues

OC的调用

这个代码OC是怎么调用的,引入头文件总是报错

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.