NSDateComponents, the iOS SDK provides a powerful system to operate on date and time values. The API however is a little verbose.
NSDate (and a few other types such as Int and String) in Swift, called Timepiece that makes date and time manipulate easier.
Creating new dates:
let now = NSDate() let christmas = now.change(month: 12, day: 25)
date < 1.year.ago
There's a Swift playground included with it, so you can check it out easily. To use it, open
Timepiece.xcworkspace and then open
Timepiece.playground from within the workspace.
Sponsored: Learn how to make money selling your own apps. Start your app publishing business: go to LearnAppMaking.com and sign up!