Introduction
Lesson 1 gave you a quick glimpse of how views interact with the mutable data in a view model.
- You created the
@Observable class TheMetStore. - You instantiated
TheMetStoreinContentViewas a@Stateproperty.
This lesson takes you deeper into the state management mechanism that enables views to observe and react to changes in the view model.
Learning Objectives
Here’s what you’ll do in this lesson:
- Implement state management within a ViewModel using Observation.
- Differentiate between
publicandprivateor@ObservationIgnoredproperties in ViewModels and their appropriate usage scenarios.