Categories To Shorten Your Objective-C Code Including JSON Helpers, And NSComparisonMethods For iOS

A couple of months ago I mentioned an interesting library allowing you to easily define your own Objective-C literals that included a number of pre-made literals allowing you to dramatically reduce the size of your Objective-C code syntax.  I also mentioned a nice collection of macros for shortening your code a couple of years back.

Here’s a library called Objective-Shorthand from Saroush Khanlou providing a number of categories to reduce the syntax when performing many common tasks.

Some of the categories included simplify:

– Regular Expressions: Pattern creation and match checking in a single step.
– JSON: A JSONKit style interface using Apple’s built-in JSON serializer.
– NSComparisonMethods: The Same API as in the OS X SDK with iOS Support for easier comparisons.
– Data Detection Methods: Check if Data is an E-mail, url, phone number, date or address.
– NSArray Convenience Methods: Make arrays unique, sort arrays
– Functional Collection Operators: Adds Map, Select and Any to NSArray, NSSet, NSDictionary
– String Methods: Check if contains, compare ignoring case

And much more – there is solid documentation for each method.

You can find Objective-Shorthand on Github here.

A very nice collection of categories.

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Categories To Shorten Your Objective-C Code Including JSON Helpers, And NSComparisonMethods For iOS

©2014 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 *