An Introduction to Swift Property Wrappers

Learn what Swift property wrappers are, and explore how they provide a useful way to make computed properties reusable across different classes.

Now that the topics of Swift classes and structures have been covered, this chapter will introduce a related topic in the form of property wrappers. Introduced in Swift 5.1, property wrappers provide a way to reduce the amount of duplicated code involved in writing getters, setters, and computed properties in class and structure implementations.

Get hands-on with 1200+ tech skills courses.