title: How do I pass arguments to the resolve method when using Swinject?
body: <p>I have a test project that I'm trying to pass an argument to the resolve method in a <a href="https://github.com/Swinject/Swinject" rel="noreferrer">Swinject</a> project. </p>
  
  <p>Here is an example of what my Swinject storyboard extetion file has in it. </p>
  
  <pre><code>import Swinject
  
  extension SwinjectStoryboard {
  
      class func setup() {
  
          let mainDm = MainDM()
  
          defaultContainer.register(MainDM.self) { _ in
              mainDm
          }
  
          defaultContainer.registerForStoryboard(ViewController.self) { r, c in
              c.dm = r.resolve(MainDM.self)
              c.container = defaultContainer
  
          }
  
  
          defaultContainer.register(GetMessageAction.self) { _, delegate in
              GetMessageAction(dm:mainDm, delegate: delegate)
          }
  
      }
  
  }
  </code></pre>
  
  <p>in my ViewController I'm trying to do the following to resolve the GetMessageAction</p>
  
  <pre><code>@IBOutlet weak var myText: UILabel!
  
      var dm:MainDM!
      var container:Container!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          NSTimer.scheduledTimerWithTimeInterval(NSTimeInterval(3), target: self, selector: #selector(ViewController.getMessage), userInfo: nil, repeats: false)
  
      }
  
      func getMessage() {
  
          let action:GetMessageAction? = container.resolve(GetMessageAction.self, argument: self)!
          action?.execute()
  
      }
  </code></pre>
  
  <p>I get the following message when my getMessage function runs</p>
  
  <blockquote>
    <p>fatal error: unexpectedly found nil while unwrapping an Optional value</p>
  </blockquote>