Summary
This was another chapter that made use of Swift macros and other advanced Swift techniques. A small note: to understand topics such as Observable, I recommend having good knowledge of Swift. Otherwise, it becomes just another boring tutorial. Knowing how things work on the inside is fascinating and can only make us better.
In this chapter, we did a recap of the SwiftUI observation system, and we discussed its problem. We added the @Observable
macro and explored how it works. We talked about computed variables, environment variables, and bindable. Ultimately, we discussed migrating from the “old” observation system to the new Observable framework.
Remember – observation is a core feature of SwiftUI and is crucial to delivering a superior experience to our users.
In the next chapter, we will learn about another critical feature, especially in mobile – navigation and search.