3a4oT/DateToolsObjC
Package for Objective-C DateTools library. Parse, validate, manipulate, and display dates, time and timezones
Use with Swift Package Manager
.package(url: "https://github.com/3a4oT/DateToolsObjC", .upToNextMajor(from: "1.0.5"))
[How to use with Carthage](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application):
- Add to your Cartfile ``
github "3a4oT/DateToolsObjC"``
Run ``carthage build 3a4oT/DateToolsObjC` Add `DateToolsObjC.framework` to your target In your `.h/*.m` just `@import DateToolsObjC;``
Can I use it from Swift?
Well, technically yes. But...=) it will work for NSDate and not for Date out the box. You will ask why? Shorty - NSDate and Date are two different types (some more food). Don't be confused about other thing you may hear that's different. So far you have 3 option to go with
- Checkout original repo and use Swift API.
- Cast Date to NSDate and back:
```swift import DateToolsObjC
let today: NSDate = Date() as NSDate //usage in DateToolsAPI return NSDate cast back if you need. let result: Date = today.timeAgo() as Date ```
- My favorite - just make Swift Extension under needed
DateToolsObjC APIwhich will cast NSDate to Date for you.
MIT License
Copyright (c) 2017 Petro Rovenskyi
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Package Metadata
Repository: 3a4oT/DateToolsObjC
Stars: 3
Forks: 2
Open issues: 1
Default branch: master
Primary language: objective-c
License: MIT
Topics: calendar, carthage, cast, date, datetools, ios, nsdate, objective-c, swift, timezone
README: README.md