From 431c5cf12ceb92b66f5bfbc752fcfa46e15826a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Van=CC=8Co?= Date: Tue, 27 Mar 2018 16:31:54 +0200 Subject: [PATCH 1/2] Update Swinject version --- Cartfile | 2 +- Cartfile.resolved | 2 +- SwinjectStoryboard.podspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cartfile b/Cartfile index 821f23d..ffef5b8 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "Swinject/Swinject" ~> 2.2 +github "Swinject/Swinject" ~> 2.3 diff --git a/Cartfile.resolved b/Cartfile.resolved index 3256b66..2f0c319 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,3 @@ github "Quick/Nimble" "v7.0.3" github "Quick/Quick" "v1.2.0" -github "Swinject/Swinject" "2.2.0" +github "Swinject/Swinject" "2.3.0" diff --git a/SwinjectStoryboard.podspec b/SwinjectStoryboard.podspec index 7f0cb3e..db122f3 100644 --- a/SwinjectStoryboard.podspec +++ b/SwinjectStoryboard.podspec @@ -17,6 +17,6 @@ Pod::Spec.new do |s| s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.10' s.tvos.deployment_target = '9.0' - s.dependency 'Swinject', '~> 2.2' + s.dependency 'Swinject', '~> 2.3' s.requires_arc = true end From 7445d756f2d753c6e7d2036b495f92cffe94a285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Van=CC=8Co?= Date: Tue, 27 Mar 2018 16:44:25 +0200 Subject: [PATCH 2/2] Update _Resolver interface --- Sources/SwinjectStoryboard.swift | 8 ++++---- Tests/Container+SwinjectStoryboardSpec.swift | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/SwinjectStoryboard.swift b/Sources/SwinjectStoryboard.swift index 5d8cec9..28c1c8e 100644 --- a/Sources/SwinjectStoryboard.swift +++ b/Sources/SwinjectStoryboard.swift @@ -104,8 +104,8 @@ public class SwinjectStoryboard: _SwinjectStoryboardBase, SwinjectStoryboardProt // https://github.com/Swinject/Swinject/issues/10 if let container = container.value as? _Resolver { let option = SwinjectStoryboardOption(controllerType: type(of: viewController)) - typealias FactoryType = (Resolver, Container.Controller) -> Container.Controller - let _ = container._resolve(name: registrationName, option: option) { (factory: FactoryType) in factory(self.container.value, viewController) } + typealias FactoryType = (Resolver, Container.Controller) -> Any + let _ = container._resolve(name: registrationName, option: option) { (factory: FactoryType) in factory(self.container.value, viewController) } as Container.Controller? } else { fatalError("A type conforming Resolver protocol must conform _Resolver protocol too.") } @@ -146,8 +146,8 @@ public class SwinjectStoryboard: _SwinjectStoryboardBase, SwinjectStoryboardProt // https://github.com/Swinject/Swinject/issues/10 if let container = container.value as? _Resolver { let option = SwinjectStoryboardOption(controllerType: type(of: controller)) - typealias FactoryType = (Resolver, Container.Controller) -> Container.Controller - let _ = container._resolve(name: registrationName, option: option) { (factory: FactoryType) in factory(self.container.value, controller) } + typealias FactoryType = (Resolver, Container.Controller) -> Any + let _ = container._resolve(name: registrationName, option: option) { (factory: FactoryType) -> Any in factory(self.container.value, controller) } as Container.Controller? } else { fatalError("A type conforming Resolver protocol must conform _Resolver protocol too.") } diff --git a/Tests/Container+SwinjectStoryboardSpec.swift b/Tests/Container+SwinjectStoryboardSpec.swift index 85ba334..519ae13 100644 --- a/Tests/Container+SwinjectStoryboardSpec.swift +++ b/Tests/Container+SwinjectStoryboardSpec.swift @@ -26,7 +26,7 @@ class Container_SwinjectStoryboardSpec: QuickSpec { expect(container.description) == "[\n" + " { Service: \(controllerType), Storyboard: SwinjectStoryboardTests.AnimalViewController, " - + "Factory: (Resolver, \(controllerType)) -> \(controllerType), ObjectScope: graph, InitCompleted: Specified }\n" + + "Factory: (Resolver, \(controllerType)) -> \(controllerType), ObjectScope: graph, InitCompleted: Specified 1 closures }\n" + "]" } }