O'Reilly logo

iOS 8 SDK Development, 2nd Edition by Janie Clayton, Chris Adamson

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

Building Our Own Delegate

Let’s think ahead. Most of our Twitter requests are going to be pretty much the same thing: get a Twitter ACAccount, send off a URL with some parameters. The only thing that’s different is the URL and the parameters, and that’s pretty easy. But the other thing our RootViewController does is all the stuff in handleTwitterData, where it currently goes through the array of tweets to make a table model.

When we’re ready to make a view controller to show the details of a tweet, or a user, or search results, or some other kind of response, that’s going to be completely different code. So the response-handling code can’t live in TwitterAPIRequest. In fact, for the app we have now, we want to leave that stuff in RootViewController ...

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