Design Patterns to Solve Complex Questions
In previous chapters, we discussed different aspects of iOS development. We covered UIKit, Swift, reactive programming, SwiftUI, Core Data, and many more. These building blocks help us achieve our next level – design patterns.
Design patterns are like tools. Each one of them solves a different problem or a different need, such as the following:
- Do we need to change the behavior of a particular instance? We can use dependency injection (DI).
- Do we have a complex state to manage? We can use Model-View-ViewModel (MVVM).
- Do we need to define communication between objects? We can use delegation.
The more we expand our toolbox with design patterns, the more problems we can solve. We should remember that design patterns alone are not our goal – they are tools to accomplish our tasks. We should remember that we’ll have to pick a particular design pattern or talk about it in our interviews.
In this...