Building custom property wrappers for SwiftUI

SwiftUI comes with some amazing built-in property wrappers like @StateObject, @ObservedObject, @FetchRequest, @Environment and more. But what if you want to add some of your own functionality to SwiftUI? Like maybe a custom version of @FetchRequest. Or maybe you want to build a property wrapper that neatly wraps a call to your backend to retrieve data.

In this talk you will learn everything you need to know about using DynamicProperty to build custom property wrappers that integrate with SwiftUI’s view lifecycle and environment beautifully. And more importantly, you will learn how you can write unit tests for your custom property wrappers as well.


Session info:

Speaker: Donny Wals

Date: 24 June 2022

Time: 11:00 - 11:50

Relevant tags:
iOS Swift 

See all speakers

See all videos