Library With A Collection Of NSFormatter Subclasses For Formatting Common Types Of Data

Earlier this year I mentioned a handy library that allows you to quickly format NSStrings using regular expressions.

Here’s a handy library from Matt Thompson called FormatterKit that provides a number of NSFormatter subclasses for formatting various types of data.

According  to the readme FormatterKit can format the following types of data:

Addresses: Create formatted address strings from components (e.g. 221b Baker St / Paddington / Greater London / NW1 6XE / United Kingdom )
Arrays: Display NSArray elements in a comma-delimited list (e.g. “Russell, Spinoza & Rawls”)
Location, Distance & Direction: Show CLLocationDistance, CLLocationDirection, and CLLocationSpeed in metric or imperial units (eg. “240ft Northwest” / “45 km/h SE”)
Ordinal Numbers: Convert cardinal NSNumber objects to their ordinal in most major languages (eg. “1st, 2nd, 3rd” / “1ère, 2ème, 3ème”)
Time Intervals: Show relative time distance between any two NSDate objects (e.g. “3 minutes ago” / “yesterday”)
Units of Information: Humanized representations of quantities of bits and bytes (e.g. “2.7 MB”)
URL Requests: Print out cURL or Wget command equivalents for any NSURLRequest (e.g. curl -X POST “https://www.example.com/” -H “Accept: text/html”)

You can find FormatterKit on Github here.

A nice time saving library for formatting data.

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Library With A Collection Of NSFormatter Subclasses For Formatting Common Types Of Data

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *