How do I write property wrappers with projected values?

In Swift, property wrappers provide a powerful way to encapsulate common behaviors related to properties, such as validation or transformation. Projected values allow access to a wrapped value's additional information. Below is an example of how to create a property wrapper with a projected value.

        @propertyWrapper
        struct Default<Value> {
            var value: Value
            
            init(wrappedValue: Value) {
                self.value = wrappedValue
            }
            
            var wrappedValue: Value {
                get { value }
                set { value = newValue }
            }
            
            var projectedValue: Default<Value> {
                return self
            }
        }

        struct Example {
            @Default("Default Value") var property
            
            func printValue() {
                print(property)   // Access wrapped value
                print(self.$property.value) // Access projected value
            }
        }

        let example = Example()
        example.printValue()
        

Swift property wrappers projected values programming iOS development