I\'m wondering if there is some new and awesome possibility to get the amount of days between two NSDates in Swift / the \"new\" Cocoa?
E.g. like in Ruby I would do:
I see a couple Swift3 answers so I'll add my own:
public static func daysBetween(start: Date, end: Date) -> Int { Calendar.current.dateComponents([.day], from: start, to: end).day! }
The naming feels more Swifty, it's one line, and using the latest dateComponents() method.
dateComponents()