Skip to content

Commit

Permalink
Update _Resolver interface
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubvano committed Mar 27, 2018
1 parent 431c5cf commit 7445d75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Sources/SwinjectStoryboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}
Expand Down Expand Up @@ -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.")
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Container+SwinjectStoryboardSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
+ "]"
}
}
Expand Down

0 comments on commit 7445d75

Please sign in to comment.