Skip to main content

Experience Design

Twenty Open Source iOS Frameworks You Should be Using

Objective-C on the iOS platform continues to rise in popularity. Between iOS and Android platforms, now there are close to 1.6 billion apps. This is a phenomenal number of apps. Given this explosion, it is but natural to see the proliferation of some excellent open source frameworks on social code repositories like Github and Google Code.
This proliferation in turn has enabled better apps to be created at faster rates. Great programmers who found gaps in what the platform lacked during their own app projects, ended up creating these reusable framework.
For this post, I studied two popular apps on iOS: Facebook and Spotify to reveal the secrets of some of the open source frameworks employed by these apps, with the hope of using some of these in your own project.
  
Category: Data Exchange
Data exchange is where your app needs to interface with some server application programming interface(API), whether your own or some third-party services like Foursquare, Yelp, Google, etc. Prior to iOS 5.0 there was no native way to handle data exchange based on JSON and a lot of open source frameworks filled this need. JSONKit and SBJSON are among two most popular.
1 & 2: JSONKit or SBJSON:
JSONKit is used by both Facebook and Flipboard, whereas Spotify uses SBJSON. Notice that Facebook abandoned SBJSON to move to JSONKit for the latest versions of its apps.
3. KissXML: Used by Spotify, this XML framework is built for speed and reliability and acts as drop-in for the built in NSXML framework.
4. Protocol Buffers ProtobufObjC: An Objective-C port of the Google Protocol Buffers. This protocol originated at Google and is an alternate to using XML. It is fast and language neutral way to describe data. Using the compiler, you can produce the code to read/write objects that look like native objects in your platform. Both Facebook and Spotify apps make use of this.
Category: Dealing with Images
Facebook apps deal heavily with images served over the web. So it was interesting to explore what types of open-source frameworks were being deployed to deal with fetching, resizing, reshaping and caching images.
5. 6. & 7. UIImage+AlphaUIImage+Resize & UIImage+RoundedCorner: This framework improves the built-in UIImage class by adding capabilities like manipulating the alpha, the size and providing ability to round corners of any image.
8.  SDWebImage: Used by Facebook, this framework offers a lot of built-in functions to make life easy if you need images to served up from the interwebs. First, this framework offers asynchronous downloads. Second, it has built-in caching support to avoid downloading the same URL multiple times.
Category: Crash Reporting
Even great apps crash. Good teams like to watch crash reports closely and fix holes proactively. Unfortunately, the built in crash reporting system by Apple is not adequate for many needs. Therefore, the following frameworks stepped in to fill these gaps.
9,10 & 11: HockeyKitQuincyKit & PLCrashReporter: Developed by the same developer, these two frameworks offer ability to stand up your own ad-hoc beta app distribution service and incorporate live crash reporting. This situation would be akin to having your own internal TestFlightApp portal and framework available. These frameworks are used by the Flipboard app. The PLCrashReporter framework is at the heart of QuincyKit.
Category: Text UI Controls:
12. HPGrowingTextView for iOS: This control is a multi-line autoresizing UITextView. It resizes itself as the user is typing. Both the old and new Facebook app use this control for the “status update” text box.
13. & 14. CoreTextHyperLinkView & AutoHyperLinks: CoreText framework is an alternative to using UIWebViews inside your apps to layout text. The CoreText framework offers great control in how the print looks without needing to render HTML. But there is one problem, if there are hyperlinks in your text that you wish to render as tappable links, there is no native support for this feature. Enter CoreTextHyperLinkView which auto-detects hyperlinks in the rendered text and makes them tappable. This control is used heavily in the News Feed section of the new Facebook app.
15. QSUtilities: Used by Facebook app, this framework has some good utility code to read/write Files for apps, general purpose string manipulation functions like escaping for XML, encoding/decoding, trimming etc.
16. RegexKitLite: This is not strictly an iOS library but it is used by Flipboard instead of the native regex functions in iOS. This stackoverflow thread discusses how to compile and link it to an iOS project.
Category: Grids and Layout:
17. AQGridView: Before iOS 6 incorporated the fancy UICollectionView, the AQGridView was the go-to grid view for many many apps. It is very flexible and is used by many leading apps such as Facebook, Spotify, and Kobo ebooks.
Category: Logging:
18. CocoaLumberJack: NSLog is simple to use. But its not very fast. And its not very extensible. To those who have used other logging frameworks in other platforms, NSLog may appear limiting. Fear not, because there is a drop in replacement for NSLog called CocoaLumberJack which makes it snappy to put log statements in your code, direct the output to multiple loggers, leave in the code without worrying about #ifdef statements to prevent it seeping through into the production code. This framework is used by both Spotify and Facebook apps.
Category: Messaging:
19. mosquitto:  This is a MQTT protocol based messaging framework for low powered devices. It is used by Facebook (but I could not figure out for what?). This framework enables machine to machine communication based on the MQTT protocol. An experimental project on Github shows how to use the iPhone to turn on or off an LED.
Category: Device Identification:
20. OpenUDID: OpenUDID is a drop in replacement for Apple’s UDID. It is adopted by many apps since Apple has restricted access to the UDID to uniquely identify a device and a user.

Conclusion:
As you can see there are a lot of useful open source frameworks that power some of the best apps on the iOS platform and their count will only continue to grow. However, watching the about pages of the apps you like may reveal the secrets of creating your own powerful apps.
 
 
 

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Amit Malhotra

More from this Author

Follow Us