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

Chapter 3Organizing Apps with Controllers

iOS apps usually consist of more than simple rectangles and buttons. We can easily build complex interfaces using the SDK; however, we need to first learn about controllers in order to create them.

Views are only one leg of the Model-View-Controller (MVC) programming paradigm adopted by the iOS SDK. A “programming paradigm” sounds intimidating, but MVC is actually fairly simple. The basic idea is that your code should have three types of objects: models to represent data, views to display those models, and controllers to process user input.

You can think of controllers as a layer between the user and the rest of your code. Their role is to interpret events and forward the changes to the relevant ...

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