blog

Image of GitHub OctoCat Logo

Found on GitHub: PrettyTimestamps

by

Jon Hocking recently released a simple category on NSDate that generates relative timestamps such as "3 hours ago" or "2 days ago" from an NSDate instance.

The code is available on GitHub at jonhocking/PrettyTimestamp and is available as a CocoaPod as well.

I’ve put together an example project to demo how the code works at stevenhuey/PrettyDates. It makes use of CocoaPods to manage dependencies so make sure to use the .xcworkspace file and run:

pod install

before trying to build and run the app.

When you save yourself some time generating some nice relative timestamps in your next app make sure give @jonhocking a mention on Twitter.

+ more

Accurate Timing

Accurate Timing

In many tasks we need to do something at given intervals of time. The most obvious ways may not give you the best results. Time? Meh. The most basic tasks that don't have what you might call CPU-scale time requirements can be handled with the usual language and...

read more