A Colection of useful playgrounds
This repo contains a collection of useful swift playgrounds.
PropertyWrappers Playground
Contains small example of usage with a multiple swift property wrappers for learning purpouses.
Property wrappers
-
ObservableObject
Protocol more. -
@Published
Class contrained more. -
@State
Should be private if possible. Holds state for specific view more. -
@StateObject
To be used together with ObservableObject more. -
@ObservedObject
more.
Tip It is really important that you use@ObservedObject
only with views that were passed in from elsewhere. You should not use this property wrapper to create the initial instance of an observable object – that’s what@StateObject
is for. -
@EnvironmentObject
more -
@Binding
Connects a property to a source of truth stored elsewhere more.