O'Reilly logo

Test-Driven iOS Development with Swift 3 by Dr. Dominik Hauser

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 3. A Test-Driven Data Model

iOS apps are often developed using a design pattern called Model-View-Controller (MVC). In this pattern, each class, struct or enum is either a model object, view, or a controller. Model objects are responsible for storing data. They should be independent from the kind of presentation by the UI. For example, it should be possible to use the same model object for an iOS app and a command-line tool on Mac.

View objects are the presenters of the data. They are responsible for making the objects visible (or hearable in the case of a VoiceOver-enabled app) for the user. Views are special for the device that the app is executed on. In the case of a cross-platform application, view objects cannot be shared. Each platform ...

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