O'Reilly logo

Beginning iOS 5 Application Development by Wei-Meng Lee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required