O'Reilly logo

RubyMotion by Clay Allsopp

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

Interacting with UITableViews

Currently our AlphabetController is the dataSource of the table, but remember how tables also have a delegate? We need to make our controller the delegate if we want it to respond when someone taps the row.

The table view’s dataSource methods are generally about supplying information to a table; the delegate methods concern themselves with what happens after the table is set up and how the user interacts with it. We’ll use one of these delegate methods to push a new view controller when a row is tapped.

We start by making our controller the delegate in viewDidLoad, just like dataSource.

 @table.dataSource = self
»@table.delegate = self

There aren’t ...

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