O'Reilly logo

iOS 9 SDK Development 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

Coding the Action

Now that we’ve added a button to our view and wired it up, we can run the app again. The app now has the Send Tweet button, and we can even tap it, but it doesn’t do anything. In fact, we don’t even know if we’ve made our connections correctly. One thing we can do as a sanity check is to log a message to make sure our code is really running. Once that’s verified, we can move on to implementing our tweet functionality.

Logging

Back in Chapter 2, we learned about the NSLog function for logging timestamped messages to the Xcode console. We can use that in our action to just log a message every time the button is tapped, and thereby verify that the connections are working. Select ViewController.swift in the File Navigator (1) to ...

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