I’m new to Xcode and I have the following problem:
I want a method that gives me the time that as passed since a given date till now.
If it was 2 years ago I want to return a string “2 years ago”, but if it was 5 minutes ago I want it to return a string with “5 minutes ago”.
I’ve already checked NSTimeInterval and NSDateFormatter but I couldn’t find a way to make it work.
Just to get you started…
You would create a reference date like this:
Current date can be obtained like this:
Time interval is in seconds, so…
I’m sure you’ll be able to figure it out on yourself from here on…
This answer might help you out.