Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit 83c2bab

Browse files
committed
fix 🚀
1 parent a55dc7c commit 83c2bab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_posts/2020-03-19-dependecy-injection-swift.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The open source Swift world is full of useful framework. You can find almost eve
2323
The main class of dependencies injector container is composed by 2 classes: `DependeciesContainer` and `DependencyKey`.
2424
The main one stores in the field `dependecies` a dictionary of all the dependencies registered using an instance of the second one. `DependeciesContainer` exposes two methods:
2525

26-
* `register<T>(type: T.Type, name: String? = nil, service: Any)`, that lets you register a new dependency in the container. It accepts 3 parameter. The first one is the `Type` of the dependency. The second one is a string that let's you identify different named variations of the same dependencies (e.g. you register `Cat` and `Dog`, two different implementation of an hypothetical `Animal` protocol). The 3 one is the instance saved in the `dependecies` dictionary.
26+
* `register<T>(type: T.Type, name: String? = nil, service: Any)`, that lets you register a new dependency in the container. It accepts 3 parameter. The first one is the `Type` of the dependency. The second one is a string that let's you identify different named variations of the same dependencies (e.g. you register `Cat` and `Dog`, two different implementation of an hypothetical `Animal` protocol). The third one is the instance saved in the `dependecies` dictionary.
2727

2828
* `resolve<T>(type: T.Type, name: String? = nil) -> T?`, that lets you get an instance previously registered. This method accept the same first two parameter of the previous method. It will return null if none of the registered instance has a combination of `type` and `name` as the one received as parameters.
2929

0 commit comments

Comments
 (0)