A Beginners Guide to Dependency Injection in Swift

Banner vector created by roserodionova — www.freepik.com

A Short Article on DI with halfway-well-thought-out examples

createNote(text:, imageThatNeedsResizing:)
No Initializer Error

Option 1: Constructor (Initializer) Injection

Option 2: Setter Injection

resize(image:, size:)

I used to teach iOS development. Now that I develop full time, I miss teaching. Writing tutorials and advice about iOS development is my coping mechanism.

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