Sitemap

Member-only story

Dependency Injection using Storyboards

You’re not restricted anymore!

5 min readFeb 23, 2021
Photo by Ben Wicks on Unsplash

Difficulty: Beginner | Easy | Normal | Challenging
This article has been developed using Xcode 12.0, and Swift 5.3
Updated for Xcode 12.4, and 5.3.2

Prerequisites:

Dependency Injection

Motivation

High level modules should not be dependent on low-level modules, but rather abstractions. If this is true, we can swap out classes rather than making a fixed dependency for a concrete class.

Why it matters

If you are using a network service (say to make those GET requests) to test screens that depend on data from the network service you will need to wait for the request to be made. Now not only is that rather boring to wait for (in larger projects this will take a great deal of time), but is seen as unprofessional as if your network…

--

--

No responses yet