December 2018
Intermediate to advanced
414 pages
10h 19m
English
Tying everything together now is straightforward. We need to port in the message-sending logic, as well as the error handling; and we should be done:
class PostMessageController: ComposeViewControllerDelegate {
Store references to the view controller, validation controller, and networking controller as follows:
let viewController = ComposeViewController() let validator = MessageValidator() let networking = PostMessageNetworking() init() { viewController.delegate = self }
The delegate method implementation: The implementation here is the core of the logic that ties the view layer to the model layer (which is the responsibility of the controller layer).
This method validates the message, attempts to send it, and updates the ...
Read now
Unlock full access