Since the switch to Swift 3.0, and along with it the change of NSDate to Date, the class no longer conforms to the NSCopying protocol.
In Swift 2, this was valid:
let newDate = oldDate.copy()
But now returns a compiler error.
With this being the case, what is the best way to duplicate a Date object?
let newDate = Date(timeIntervalSince1970: oldDate.timeIntervalSince1970)
This will do the trick, but it doesn't seem particularly elegant. And it is potentially (theoretically) susceptible to loss of precision as a TimeInterval is a Double (and we have no way of confirming that a Date object internals uses - or always will use - a Double).
let newDate = ((oldDate as NSDate).copy()) as! Date
:) – Jerboa