Now that we've compared two of the most common design patterns and we can see where SwiftUI fits within them, we'll take a deeper look at how we can actually write SwiftUI to conform to one of these patterns. In this section, we'll cover what a binding is and how this helps us adhere to the MVVM pattern. We'll also cover states, which show why Controller logic in MVC has no place in SwiftUI.
Design patterns in SwiftUI
Observable objects
Next, we are going to look at observable objects, and by observable we mean models that can change state or be updated due to an external API call. For example, a model that houses weather information from a weather API might get updated periodically. We would want our UI...