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] 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" + "]" } }