CodeX
Published in

CodeX

Dependency Injection in Swift 5

Picture by James Yarema in Unsplash.

iOS developers have been using Dependency Injection (DI) for years. It’s a technique for decoupling components in an iOS app by injecting them with the services they need, rather than hard-coding those dependencies. This allows for more modular, testable code.

Swift 5 introduces new property wrappers that make DI even easier. Property wrappers are pieces of code that add functionality to properties, without…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store