A small iOS framework to better handle Swift Dates and Time operations.
SweetDate is a work in progress, in the mean time you can enjoy the nice improvements it can offer to your coding environment.
To integrate SweetDate into your Xcode project using CocoaPods, specify it in your Podfile:
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'SweetDate'
end
Then, run the following command:
$ pod install
End with an example of getting some data out of the system or using it for a little demo
SweetDate makes it easy for you to create Date Types with common sense coding scenarios.
SweetDate supports the 3 most popular worldwide formats:
Format | Description |
---|---|
.mdy | Month - Day - Year |
.dmy | Day - Month - Year |
.ymd | Year - Month - Day |
You can create a date value by calling the dateWithFormat method after any string declaration. You only need to specify the date format.
"12-02-2017".dateWithFormat(Format: .mdy)
You can create a date value by calling the fromString method after any static call to the "Date" Data Type. You only need to specify the date String and the date format.
Date.fromString(Date: "12-02-2017", Format: .mdy)
This project is licensed under the MIT License - see the LICENSE file for details