Setting Up Twitter API Calls

When we first set up our tweet-sending button, we found the documentation for the Social framework and made use of the SLComposeViewController. To start using the rest of Twitter’s features (or any other social network supported by iOS), we’ll need to use another class in this framework. SLRequest lets us call the various social networks’ web APIs by just providing a URL, whose contents vary by service and are documented at their various developer sites (such as http://dev.twitter.com). For Twitter, we have an additional detail to work through first: as of May 2013, all Twitter requests need to be authenticated, meaning they need to come from a signed-in Twitter user.

Fortunately, iOS allows a user to sign in to ...

Get iOS 9 SDK Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.