flâneur — a map of the web's best reading

Simple Swift dependency injection with functions | Swift by Sundell

swiftbysundell.com · 703 words · saved by 1 readers

Dependency injection is a great technique for decoupling code and making it easier to test. In this article, let’s take a look at how functions can be used for simple dependency injection.

This article has been archived, as it was published several years ago, so some of its information might now be outdated. For more recent articles, please visit the main article feed . Simple Swift dependency injection with functions dependency injection functions Swift 5.1 Published on 18 Mar 2017 Dependency injection is a great technique for decoupling code and making it easier to test. The core idea is that rather than having our objects create their own dependencies by themselves, we inject them from the outside, enabling us to set them up differently for various situations — such as using

Explore this link on the map →

related reading