Simple Swift Tool for convenience Date usage in your project
Tomorrow
Simple Swift Tool for convenience Date usage in your project.
Features
- ℹ️ Parsing ISO8601 String to Date
- Auto handling formats with and without milliseconds
- Use ISO8601DateFormatter in new systems (iOS 11.0+, macOS 10.13+, tvOS 11.0+, watchOS 4.0+)
Example
// "2020-11-01T21:10:56Z"
// "2020-11-01T21:10:56.715+01:00"
// "2020-11-01T21:10:56.22+02:00"
let date = Date.fromISO("2020-11-01T21:10:56.22+02:00")
Installation
CocoaPods
Tomorrow is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod 'Tomorrow'
Carthage
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
To integrate Tomorrow into your Xcode project using Carthage, specify it in your Cartfile
:
github "lukszar/Tomorrow"
Run carthage update
to build the framework and drag the built Tomorrow.framework
into your Xcode project.
On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase” and add the Framework path as mentioned in Carthage Getting started Step 4, 5 and 6
Swift Package Manager
To integrate using Apple's Swift Package Manager, add the following as a dependency to your Package.swift
:
dependencies: [
.package(url: "https://github.com/lukszar/Tomorrow.git", from: "1.0.0")
]
Alternatively navigate to your Xcode project, select Swift Packages
and click the +
icon to search for Tomorrow
.
Manually
If you prefer not to use any of the aforementioned dependency managers, you can integrate Tomorrow into your project manually. Simply drag the Sources
Folder into your Xcode project.
Further development
This simple tool was created to check SwiftKit in action.
I plan to extend this tool with new features soon. Stay tuned!