Swift 5.1 Takes Dependency Injection to the Next Level

Swift 5.1 Takes Dependency Injection to the Next Level

Fortunately, Swift 5.1 provided us with a new tool call property wrappers, (formally known as “property delegates”), pitched on the Swift forum as part of proposal SE-0258 and added to Swift 5.1 and Xcode 11.

[…]

So automatically wrapping properties in get/set pairs doesn’t sound that exciting, but property wrappers are going to have a major impact on our Swift code.

[…]

NOTE: The above implementation was updated as of Xcode Beta 6 and supports the wrappedValue and projectedValue changes to the propertyWrapper syntax that occurred in Beta 5.

[…]