https://github.com/chicio/dependencies-injection-swift-example
A simple dependencies injection container I created for my blog post "How to: create your SUPER simple dependency injector framework in Swift" :bird::iphone:
https://github.com/chicio/dependencies-injection-swift-example
dependency-injection generics hashable-dictionaries metaprogramming swift
Last synced: 7 months ago
JSON representation
A simple dependencies injection container I created for my blog post "How to: create your SUPER simple dependency injector framework in Swift" :bird::iphone:
- Host: GitHub
- URL: https://github.com/chicio/dependencies-injection-swift-example
- Owner: chicio
- License: mit
- Created: 2020-03-19T11:27:00.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-12-28T08:34:31.000Z (over 4 years ago)
- Last Synced: 2025-01-17T22:43:46.082Z (over 1 year ago)
- Topics: dependency-injection, generics, hashable-dictionaries, metaprogramming, swift
- Language: Swift
- Homepage: https://www.fabrizioduroni.it/blog/
- Size: 12.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# dependencies-injection-swift-example
[](https://github.com/chicio/dependencies-injection-swift-example/blob/master/LICENSE.md)
[](https://img.shields.io/badge/platforms-iOS-orange.svg)
A sample project for my blog post post [How to: create your SUPER simple dependency injector framework in Swift](https://www.fabrizioduroni.it/2020/03/19/dependecy-injection-swift/), where I show how to create a simple dependecies injector container in Swift.
### Description
This is a quote from the post:
> ...We have a lot of alternatives from which we can choose: [Swinject](https://github.com/Swinject/Swinject "dependecies injection swift Swinject"), [Weaver](https://github.com/scribd/Weaver "dependecies injection swift Weaver") etc. This frameworks come with a lot of features like: object graph construction, injection with property wrappers, instance persistence etc. This are all useful feature, but if your needs are very limited (just a dependecies container register/resolver using protocol and classes) the previous frameworks gives you just a big overhead and complexity on you code. This is why for my recent project I tried to write my own very simple dependencies injector container by leveraging the power of Swift Metatype and the Hashable protocol. Let's go and see the how I created it...
Click on the link above to read the posts.