The way we work with dates has changed in Swift 3, the change makes it’s way simpler then before. Let’s look at an example: //CreateDateFromComponents (1st January 2017) var newDate = Date() let newDateComponents = DateComponents(calendar: Calendar.current, timeZone: nil, era: nil, year: 2017, …
Tag Archives: NSDateComponents
Dates & Components in Swift 2.0
Another topic that has been changed in Swift 2.0 is how to work with dates. I’m digging into this topic for my upcoming app and I’ve found that most documentation on the web refers to Swift 1.2. So here are some snippets to create dates using components: //CreateDateFromComponents (1st January 2016) var …