Working With Property Wrappers

2 Episodes

Episode 1

08:19

Anatomy of a Property Wrapper

Property wrappers were introduced in Swift 5.1 to eliminate boilerplate code, facilitate code reuse, and enable more expressive APIs. You may have noticed that SwiftUI and Combine make heavy use of property wrappers. Property wrappers are completely optional. You can write Swift without property wrappers. But once you become familiar with their benefits and understand how they work, you will understand why the Swift community is so excited about this addition to the language.

Episode 2

08:10

Initial Values and Projected Values

In the previous episode, you learned about the anatomy of property wrappers. Property wrappers aim to reduce code duplication and improve the readability of the code you write. They also implicitly document the code when implemented and applied correctly. That is an added bonus. In this episode, we explore a few additional features of property wrappers.