Skip to content

Commit

Permalink
when injecting into a window controller, injection is also done on th…
Browse files Browse the repository at this point in the history
…e contentViewController
  • Loading branch information
mlilback committed Jun 30, 2016
1 parent d9ad97f commit 4eed766
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/SwinjectStoryboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ public class SwinjectStoryboard: _SwinjectStoryboardBase, SwinjectStoryboardType
} else {
fatalError("A type conforming ResolverType protocol must conform _ResolverType protocol too.")
}

if let windowController = controller as? NSWindowController, let viewController = windowController.contentViewController {
injectDependency(viewController)
}
if let viewController = controller as? NSViewController {
for child in viewController.childViewControllers {
injectDependency(child)
Expand Down

0 comments on commit 4eed766

Please sign in to comment.