INTEGRATING TWITTER INTO YOUR APPLICATION

In iOS 5, Twitter integration has been built right into the OS. A lot of built-in applications now support Twitter — Safari, Photos, Camera, YouTube, Maps, etc. In order to tweet directly from within all these applications, you first need to set up your Twitter account in the Settings application. Figure 16-12 shows the Twitter item in the Settings application on the iPhone Simulator. Clicking on the Twitter item allows you to sign in to your existing Twitter account, or create a new one if you do not already have an account.

image

FIGURE 16-12

Besides the built-in applications' support for Twitter, you can also integrate Twitter support in your own application. The following Try It Out shows you how easy it is to enable users to tweet directly from your application.

TRY IT OUT: Tweeting Directly from Your Application

image

  1. Using Xcode, create a new Single View Application (iPhone) project and name it Twitter. Use the project name as the Class Prefix and ensure that you have the Use Automatic Reference Counting option unchecked.
  2. Add the Twitter.framework to your project (see Figure 16-13).

    image

    FIGURE 16-13

  3. Select the TwitterViewController.xib file to edit ...

Get Beginning iOS 5 Application 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.