Property wrapper in swift | Property wrapper vs Extension

Опубликовано: 08 Февраль 2026
на канале: Rajesh Sharma
930
17

*#SWIFTUI :- #PropertyWrapper in swift *
This video covers :
1. What is a property wrapper in Swift?
2. What is an Extension.
3. Property wrapper vs Extension
4. why we need to use property wrapper .
5. In which situation you have to use property wrapper and extension.
6. What limitations does the Property wrapper have?
______________________________________________

Git Hub Source Code - https://github.com/raj-engineer/Swift...
_______________________________________________


What is Property Wrapper in swift.
Property wrappers were introduced in Swift 5.1 to allow users to add additional behavior to properties.

A property wrapper is a generic structure that encapsulates read and write access to the property and adds additional behavior to it

What limitations does the wrapper have?

Property wrappers come not without their price. They impose a number of restrictions :

1. Applying multiple wrappers to the property is not allowed. .
2. always need to defined with ‘@properWrapper’ and must have ‘wrappedValue’ property.
3. cannot be set as ‘lazy’, ‘weak’, ‘unowned’ or ‘@NSManaged’.
4. cannot be declared in protocol or extension.
5. cannot be overridden.
6. cannot have custom ‘get’ or ‘set’.
_____________________________________________________________
If You think this is Helpful for you so , please share and Subscribe my channel .

Good place to learn iOS Application Development , Swift ,SwiftUI. I try explain all the things in very simple and easy manner.

"If you can't explain it simply, you don't understand it well enough."
Albert Einstein