From 13782a9acf23dcfcf938c227c26a68b8a34a6fc0 Mon Sep 17 00:00:00 2001 From: Aleksandr Teplyakov Date: Tue, 7 May 2019 18:13:35 +0300 Subject: [PATCH] swift 5 support prevent wrapping autoclosures --- EasyDi.podspec.json | 2 +- Sources/EasyDi.swift | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/EasyDi.podspec.json b/EasyDi.podspec.json index ed8203c..e258b37 100644 --- a/EasyDi.podspec.json +++ b/EasyDi.podspec.json @@ -2,7 +2,7 @@ "name": "EasyDi", "version": "1.4.0", "summary": "Effective DI library for rapid development in 200 lines of code", - "description": "Swift 3 and 4, iOS 8+\nEasyDi 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:\n- Objects creating with dependencies and injection of dependencies into existing ones\n- Separation into assemblies\n- Types of dependency resolution: objects graph, singleton, prototype\n- Objects substitution and dependency contexts for tests", + "description": "Swift 3 and 4 and 5, iOS 8+\nEasyDi 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:\n- Objects creating with dependencies and injection of dependencies into existing ones\n- Separation into assemblies\n- Types of dependency resolution: objects graph, singleton, prototype\n- Objects substitution and dependency contexts for tests", "homepage": "https://github.com/AndreyZarembo/EasyDi.git", "license": { "type": "MIT", diff --git a/Sources/EasyDi.swift b/Sources/EasyDi.swift index d60fef6..26fcacb 100644 --- a/Sources/EasyDi.swift +++ b/Sources/EasyDi.swift @@ -263,13 +263,10 @@ open class Assembly: AssemblyInternal { into initClosure: @autoclosure @escaping () -> ObjectType, inject injectClosure: ObjectInjectClosure? = nil ) { - let _: ObjectType = self.define( - key: key, - definitionKey: definitionKey, - scope: scope, - init: initClosure, - inject: injectClosure - ) + let _: ObjectType = define(key: key, definitionKey: definitionKey, scope: scope) { (definition:Definition) in + definition.initClosure = initClosure + definition.injectClosure = injectClosure + } } /// This method defines object, which will be initialized and injected by assembly.