In an effort to help teach concepts about Dependency Injection (DI) using Swift, I went through @NatashaTheRobot's Unit Testing in Swift: Dependency Injection blog post and implemented her approach using the now-current version of Swift (2.1.1) with a few additional tweaks:
- Changed the approach from Method Injection to Constructor (Initializer) Injection
- Made use of protocol extensions
- Appoached development using more of a TDD style
- Gave examples of both synchronous and asynchronous invocations to illustrate the difference between them