December 2018
Intermediate to advanced
414 pages
10h 19m
English
ViewModel, as mentioned previously, is meant to provide a usable representation of Model to the View layer. It will also provide a way to bind itself to events. In Swift, we can use closures, in order to attach the callbacks to ViewModel:
class ViewModel {
Similar to ApplicationController in the MVC pattern, we'll keep track of the main Model manager, which is the QuestionController in ViewModel:
private let questions = QuestionController()
Keeping ...
Read now
Unlock full access