Andrey Zarembo

2pods

EasyDi

Swift 3 and 4, iOS 8+ EasyDi contains a dependency container for Swift. The syntax of this library was specially designed for rapid development and effective use. It fits in 200 lines, thus can do everything you need for grown-up DI library: - Objects creating with dependencies and injection of dependencies into existing ones - Separation into assemblies - Types of dependency resolution: objects graph, singleton, prototype - Objects substitution and dependency contexts for tests

License: MIT

  • Swift

SwiftInjections

Syntax of object definition was made simple and easy to use. It differs from Typhoon's one, but has some look a like elements that makes learning easier.

public var object:TheObject { return self.define() { (definition) in let object1 = definition *~> Object1() object1.object2 = self.assembly2.object2 return object1 } } Each injectable object is defined as computed property of Assembly. Object itself is created by call of assemblies method define, with object injection definition closure. Definition object should be used to initialize object with method initObject or by means of *~> operator to correctly resolve circular dependencies.

License: MIT

  • Swift