Skip to content

Commit

Permalink
Merge pull request #88 from jakubvano/swinject_2.3_compatibility
Browse files Browse the repository at this point in the history
Swinject 2.3 compatibility
  • Loading branch information
jakubvano authored Mar 28, 2018
2 parents e33350c + 7445d75 commit 8536924
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "Swinject/Swinject" ~> 2.2
github "Swinject/Swinject" ~> 2.3
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -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"
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 SwinjectStoryboard.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 8536924

Please sign in to comment.