{"action":"created","issue":{"url":"https://api.github.com/repos/Swinject/Swinject/issues/51","repository_url":"https://api.github.com/repos/Swinject/Swinject","labels_url":"https://api.github.com/repos/Swinject/Swinject/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/Swinject/Swinject/issues/51/comments","events_url":"https://api.github.com/repos/Swinject/Swinject/issues/51/events","html_url":"https://github.com/Swinject/Swinject/issues/51","id":126256757,"number":51,"title":"Pass assembler while assembling containers","user":{"login":"Nikita2k","id":5546990,"avatar_url":"https://avatars.githubusercontent.com/u/5546990?v=3","gravatar_id":"","url":"https://api.github.com/users/Nikita2k","html_url":"https://github.com/Nikita2k","followers_url":"https://api.github.com/users/Nikita2k/followers","following_url":"https://api.github.com/users/Nikita2k/following{/other_user}","gists_url":"https://api.github.com/users/Nikita2k/gists{/gist_id}","starred_url":"https://api.github.com/users/Nikita2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nikita2k/subscriptions","organizations_url":"https://api.github.com/users/Nikita2k/orgs","repos_url":"https://api.github.com/users/Nikita2k/repos","events_url":"https://api.github.com/users/Nikita2k/events{/privacy}","received_events_url":"https://api.github.com/users/Nikita2k/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Swinject/Swinject/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2016-01-12T19:31:49Z","updated_at":"2016-02-04T09:27:07Z","closed_at":null,"body":"This is not an issue, but a suggestion/idea.\r\n\r\nAssume I have a `RootController` and `RootRouter`. The last one is responsible for presenting (modal/push, animation, etc) other controllers. I want to present `AnimalController` (which has it's own dependencies).\r\n\r\nI have the following assemblies diagram:\r\n- RootAssembly\r\n  - RootController AssemblyType\r\n  - Services AssemblyType (api, db, etc)\r\n- AnimalAssembly.\r\n\r\nAfter #50 I can make animal assembly with parent assembly (I really need to access db from `AnimalController`).\r\n\r\nSo here is the problem:\r\n\r\n```\r\nclass RootControllerContainer: AssemblyType {\r\n    \r\n    func assemble(container: Container) {\r\n        \r\n        container.register(RootController.self) { r in\r\n            RootController(router: r.resolve(RootRouter.self)!)\r\n        }\r\n        \r\n        container.register(RootRouter.self) { _ in\r\n            RootRouter()\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nNow I'd like to create a `AnimalController` inside `RootRouter.swift`:\r\n\r\n```\r\nfunc showDogDetails(dog: Dog) {\r\n    let animalController = ???\r\n    rootController.navigationController.pushViewController(animalController, animated: true)\r\n}\r\n```\r\nSo the question is how do I construct `AnimalAssembly` with `RootAssembly`? When we were working with `Containers` I was able to create new container with given parent.\r\n\r\nSo I suggest:\r\nPass assembler reference in `assemble` func, so I can register components, that is dependant on this assembler."},"comment":{"url":"https://api.github.com/repos/Swinject/Swinject/issues/comments/179728784","html_url":"https://github.com/Swinject/Swinject/issues/51#issuecomment-179728784","issue_url":"https://api.github.com/repos/Swinject/Swinject/issues/51","id":179728784,"user":{"login":"yoichitgy","id":965994,"avatar_url":"https://avatars.githubusercontent.com/u/965994?v=3","gravatar_id":"","url":"https://api.github.com/users/yoichitgy","html_url":"https://github.com/yoichitgy","followers_url":"https://api.github.com/users/yoichitgy/followers","following_url":"https://api.github.com/users/yoichitgy/following{/other_user}","gists_url":"https://api.github.com/users/yoichitgy/gists{/gist_id}","starred_url":"https://api.github.com/users/yoichitgy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoichitgy/subscriptions","organizations_url":"https://api.github.com/users/yoichitgy/orgs","repos_url":"https://api.github.com/users/yoichitgy/repos","events_url":"https://api.github.com/users/yoichitgy/events{/privacy}","received_events_url":"https://api.github.com/users/yoichitgy/received_events","type":"User","site_admin":false},"created_at":"2016-02-04T09:27:07Z","updated_at":"2016-02-04T09:27:07Z","body":"Hello @brigade-juni. Thanks for your kind comment. I'll write something about VIPER in my blog post hopefully in February.\r\n\r\nBefore that, I have to give a conclusion to #58.\r\n\r\n@Nikita2k shares his VIPER templates at https://github.com/Nikita2k/SwiftViper. They are very helpful to develop an app in the architecture."}}