An open API service indexing awesome lists of open source software.

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:

Awesome Lists containing this project

README

          

# dependencies-injection-swift-example

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/chicio/dependencies-injection-swift-example/blob/master/LICENSE.md)
[![Supported platform](https://img.shields.io/badge/platforms-iOS-orange.svg)](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.