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

Get RubyMotion now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.