Member-only story
Dependency Injection using Storyboards
You’re not restricted anymore!
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:
- You will be expected to be aware how to make a [Single View Application](https://medium.com/swlh/your-first-ios-application-using-xcode-9983cf6efb71
- You should be able to handle segues, but I’m sure you can do that already
- You should be aware of, or have some interest in Dependency Injection)
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…