         let viewController = super.instantiateViewControllerWithIdentifier(identifier)
         SwinjectStoryboard.popInstantiatingStoryboard()
 
-        injectDependency(viewController)
+        if !SwinjectStoryboard.isCreatingStoryboardReference {
+            injectDependency(viewController)
+        }
 
         return viewController
     }

        let controller = super.instantiateControllerWithIdentifier(identifier)
        SwinjectStoryboard.popInstantiatingStoryboard()

        injectDependency(controller)

        return controller
    }

        //    container.resolve(controller.dynamicType, argument: controller as Container.Controller, name: registrationName)
        let nameWithActualType = String(reflecting: controller.dynamicType) + ":" + (registrationName ?? "")
        container.value.resolve(Container.Controller.self, name: nameWithActualType, argument: controller as Container.Controller)

        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)
