{"action":"closed","issue":{"url":"https://api.github.com/repos/Swinject/Swinject/issues/81","repository_url":"https://api.github.com/repos/Swinject/Swinject","labels_url":"https://api.github.com/repos/Swinject/Swinject/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/Swinject/Swinject/issues/81/comments","events_url":"https://api.github.com/repos/Swinject/Swinject/issues/81/events","html_url":"https://github.com/Swinject/Swinject/issues/81","id":147387307,"number":81,"title":"View Controller injection MVP","user":{"login":"davidosorio","id":2844659,"avatar_url":"https://avatars.githubusercontent.com/u/2844659?v=3","gravatar_id":"","url":"https://api.github.com/users/davidosorio","html_url":"https://github.com/davidosorio","followers_url":"https://api.github.com/users/davidosorio/followers","following_url":"https://api.github.com/users/davidosorio/following{/other_user}","gists_url":"https://api.github.com/users/davidosorio/gists{/gist_id}","starred_url":"https://api.github.com/users/davidosorio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidosorio/subscriptions","organizations_url":"https://api.github.com/users/davidosorio/orgs","repos_url":"https://api.github.com/users/davidosorio/repos","events_url":"https://api.github.com/users/davidosorio/events{/privacy}","received_events_url":"https://api.github.com/users/davidosorio/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Swinject/Swinject/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-04-11T10:42:44Z","updated_at":"2016-04-12T13:41:12Z","closed_at":"2016-04-12T13:41:12Z","body":"Hello there, I am using the pattern MVP in my app, but I have some trouble when I want to set the view to my presenter. \r\n\r\nWe can't resolve explicitly the view controllers registered by registerForStoryboard method, so I wonder how to get the view controller when I am registering the presenter, I was thinking about set the view to the presenter in registerForStoryboard method, but I don't know if it is correct. Any help please?\r\n\r\n```\r\nlet mainContainer: Container = Container() { container in\r\n\r\n        container.register(Presenter.self){ r in\r\n            return Presenter()\r\n        }.initCompleted { r,c in\r\n            let view = /* HOW GET THE VIEW */\r\n            c.view = view\r\n        }\r\n        \r\n        container.registerForStoryboard(Test1ViewController.self) { r, c in\r\n            let presenter = r.resolve(Presenter.self)\r\n            c.presenter = presenter\r\n        }\r\n}\r\n```\r\n\r\nIn AppDelegate:\r\n\r\n```\r\nlet sb = SwinjectStoryboard.create(name: \"Main\", bundle: nil, container: self.mainContainer)\r\nlet controller = sb.instantiateViewControllerWithIdentifier(\"Test1View\") as! Test1ViewController\r\n```"}}