I have a number of dates that I am trying to represent using a relative date such as \"Today, Yesterday, 1 week ago, 1 month ago\" etc...
This is the Swift code I am usi
You should have a look at Mattt Thompsons Blog post about NSDateComponentsFormatter
http://nshipster.com/nsdatecomponents/ and http://nshipster.com/nsformatter/
let formatter = NSDateComponentsFormatter()
formatter.unitsStyle = .Full
let components = NSDateComponents()
components.day = 1
components.hour = 2
let string = formatter.stringFromDateComponents(components)
// 1 day, 2 hours
Example (by Mattt Thompson)