Twitter integration is a common requirement of iPhone apps. Indeed, two of the apps my company sells are built around Twitter. Many other apps I’ve worked on for clients have also required Twitter integration.
I’m hoping to make that job a little easier for other iOS (and Mac) developers in the future by releasing TwitterKit, a simple and lightweight library for communicating with the Twitter REST API. TwitterKit should work with iOS 4.0 and up, and Mac OS X 10.6 and up. (I haven’t tested it on the latter yet, though.)
TwitterKit was built with a few goals in mind.
- Simple. TwitterKit is designed to keep the simple things simple. It has a small and clear API. There are a small number of general methods for sending API requests, rather than one Objective-C method that maps to each available REST API method.
- Small. TwitterKit is a small library. You won’t need to triple your build time just so you can post a tweet from your app.
- Easy to use. TwitterKit’s minimal API means it should be straightforward for most people to get started quickly.
- Flexible. TwitterKit is designed to handle changes to the Twitter REST API, including both new methods and changing parameters to existing ones, without requiring changes to the library itself.
- No dependencies. No conflicts. TwitterKit is completely self-contained, and it won’t clash with other libraries you may already be using in your app. Just drop the source files into your project and you’re ready to go.
In addition to providing support for the Twitter REST API, TwitterKit also includes a simple wrapper for authenticating your app using the Twitter OAuth web flow.
Give it a try in your app. If you find any bugs, or have any suggestions whatsoever, please feel free to file issues on GitHub. Any and all feedback is certainly welcome.