Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Adds Dependency Injection mechanism and change protocol conformance #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JesusMartinAlonso
Copy link

This pull request aims to achieve a mechanism to provide dependencies to VIPER modules.

The createModule method of Router class receives a ServiceLocator object as argument. This object provides all the dependencies of the app and will be used to provides dependencies of the module.

In this way, the service locator object is passed between modules.

An example of ServiceLocator implementation can be found here

Apart from these modifications, I have moved the implementation of some protocols to extensions in order to improve legibility (https://github.com/raywenderlich/swift-style-guide#protocol-conformance)

I understand that this pull request tie the user to use the proposed dependency injection mechanism, so I will understand that the PR will be rejected. Anyway, I hope it will be useful for someone.

Thanks!

…` and `copy` to avoid the template to be deleted.
… adds ServiceLocator to provide dependencies to modules
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant