{"action":"created","issue":{"url":"https://api.github.com/repos/kitasuke/PagingMenuController/issues/270","repository_url":"https://api.github.com/repos/kitasuke/PagingMenuController","labels_url":"https://api.github.com/repos/kitasuke/PagingMenuController/issues/270/labels{/name}","comments_url":"https://api.github.com/repos/kitasuke/PagingMenuController/issues/270/comments","events_url":"https://api.github.com/repos/kitasuke/PagingMenuController/issues/270/events","html_url":"https://github.com/kitasuke/PagingMenuController/issues/270","id":176921340,"number":270,"title":"\"Struct declaration cannot close over value 'self' defined in outer scope\" and multiple instantiation of View Controllers in PMC","user":{"login":"nickdnk","id":8411314,"avatar_url":"https://avatars.githubusercontent.com/u/8411314?v=3","gravatar_id":"","url":"https://api.github.com/users/nickdnk","html_url":"https://github.com/nickdnk","followers_url":"https://api.github.com/users/nickdnk/followers","following_url":"https://api.github.com/users/nickdnk/following{/other_user}","gists_url":"https://api.github.com/users/nickdnk/gists{/gist_id}","starred_url":"https://api.github.com/users/nickdnk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickdnk/subscriptions","organizations_url":"https://api.github.com/users/nickdnk/orgs","repos_url":"https://api.github.com/users/nickdnk/repos","events_url":"https://api.github.com/users/nickdnk/events{/privacy}","received_events_url":"https://api.github.com/users/nickdnk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-14T14:24:03Z","updated_at":"2016-10-14T09:23:20Z","closed_at":null,"body":"According to the documentation, the following code will implement the framework using storyboards.\r\n\r\n```\r\nstruct MenuItem1: MenuItemViewCustomizable {}\r\nstruct MenuItem2: MenuItemViewCustomizable {}\r\n\r\nstruct MenuOptions: MenuViewCustomizable {\r\n    var itemsOptions: [MenuItemViewCustomizable] {\r\n        return [MenuItem1(), MenuItem2()]\r\n    }\r\n}\r\n\r\nstruct PagingMenuOptions: PagingMenuControllerCustomizable {\r\n    var componentType: ComponentType {\r\n        return .All(menuOptions: MenuOptions(), pagingControllers: [UIViewController(), UIViewController()])\r\n    }\r\n}\r\n\r\nlet pagingMenuController = self.childViewControllers.first as! PagingMenuController\r\npagingMenuController.delegate = self\r\npagingMenuController.setup(options)\r\n```\r\n\r\nWhere do you define the `options` variable passed at the bottom? How do you customize it?\r\n\r\nAlso I cannot replace\r\n`return .All(menuOptions: MenuOptions(), pagingControllers: [UIViewController(), UIViewController()])`\r\n\r\nwith\r\n\r\n`return .All(menuOptions: MenuOptions(), pagingControllers: [myViewController1, myViewController2])` - it says:\r\n\r\n`Struct declaration cannot close over value 'self' defined in outer scope.`\r\n\r\nI don't understand where things get instantiated. It looked through the example project multiple times, but I cannot figure out which parts are essential and which parts are part of the demo only.\r\n\r\nCan you please elaborate on how to as simply as possible send 2 view controllers to the PagingMenuController. I accomplished this with the beta version before it was converted to protocol oriented programming."},"comment":{"url":"https://api.github.com/repos/kitasuke/PagingMenuController/issues/comments/253751299","html_url":"https://github.com/kitasuke/PagingMenuController/issues/270#issuecomment-253751299","issue_url":"https://api.github.com/repos/kitasuke/PagingMenuController/issues/270","id":253751299,"user":{"login":"PhilizSwiss","id":22832640,"avatar_url":"https://avatars.githubusercontent.com/u/22832640?v=3","gravatar_id":"","url":"https://api.github.com/users/PhilizSwiss","html_url":"https://github.com/PhilizSwiss","followers_url":"https://api.github.com/users/PhilizSwiss/followers","following_url":"https://api.github.com/users/PhilizSwiss/following{/other_user}","gists_url":"https://api.github.com/users/PhilizSwiss/gists{/gist_id}","starred_url":"https://api.github.com/users/PhilizSwiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhilizSwiss/subscriptions","organizations_url":"https://api.github.com/users/PhilizSwiss/orgs","repos_url":"https://api.github.com/users/PhilizSwiss/repos","events_url":"https://api.github.com/users/PhilizSwiss/events{/privacy}","received_events_url":"https://api.github.com/users/PhilizSwiss/received_events","type":"User","site_admin":false},"created_at":"2016-10-14T09:23:19Z","updated_at":"2016-10-14T09:23:19Z","body":"I've the same problem... How can I access in PagingMenuOptions to viewControllers defined outside the struct ?"}}
{"actor":{"display_login":"PhilizSwiss"}}