O'Reilly logo

Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android by Michael Eierman, Jakob Iversen

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

Passing Data Between Controllers

The Birthday label on the Contacts screen is changed on the Date screen. When the user taps the Change button next to the birthday, the Date screen is opened with a Date Picker, where the user can choose the desired date. Tapping the Save button brings the user back to the Contact screen and changes the Birthday label to what was chosen in the Date Picker.

The standard way to pass data back from a View Controller is to use the delegate pattern. With this pattern, you will have a reference in the Date Controller back to whatever controller called it (allowing for the Date Controller to be used in many contexts), as well as one or more methods that the Date Controller knows exist in the calling controller. The delegate ...

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