{"action":"created","issue":{"url":"https://api.github.com/repos/devxoul/URLNavigator/issues/11","repository_url":"https://api.github.com/repos/devxoul/URLNavigator","labels_url":"https://api.github.com/repos/devxoul/URLNavigator/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/devxoul/URLNavigator/issues/11/comments","events_url":"https://api.github.com/repos/devxoul/URLNavigator/issues/11/events","html_url":"https://github.com/devxoul/URLNavigator/pull/11","id":150003857,"number":11,"title":"Add support setting navigator scheme.","user":{"login":"devxoul","id":931655,"avatar_url":"https://avatars.githubusercontent.com/u/931655?v=3","gravatar_id":"","url":"https://api.github.com/users/devxoul","html_url":"https://github.com/devxoul","followers_url":"https://api.github.com/users/devxoul/followers","following_url":"https://api.github.com/users/devxoul/following{/other_user}","gists_url":"https://api.github.com/users/devxoul/gists{/gist_id}","starred_url":"https://api.github.com/users/devxoul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devxoul/subscriptions","organizations_url":"https://api.github.com/users/devxoul/orgs","repos_url":"https://api.github.com/users/devxoul/repos","events_url":"https://api.github.com/users/devxoul/events{/privacy}","received_events_url":"https://api.github.com/users/devxoul/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-21T08:31:30Z","updated_at":"2016-04-22T11:26:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/devxoul/URLNavigator/pulls/11","html_url":"https://github.com/devxoul/URLNavigator/pull/11","diff_url":"https://github.com/devxoul/URLNavigator/pull/11.diff","patch_url":"https://github.com/devxoul/URLNavigator/pull/11.patch"},"body":"Another implementation for #10\r\n\r\n```swift\r\nNavigator.scheme = \"myapp\"\r\nNavigator.map(\"/user/<int:id>\", UserViewController.self)\r\nNavigator.map(\"/alert\") { _ in print(\"Alert\") }\r\n\r\nNavigator.push(\"/user/123\")\r\nNavigator.present(\"/user/123\")\r\nNavigator.open(\"/alert?title=Hi\")\r\n```\r\n\r\nthis is equivalent to:\r\n\r\n```swift\r\nNavigator.map(\"myapp://user/<int:id>\", UserViewController.self)\r\nNavigator.map(\"myapp://alert\") { _ in print(\"Alert\") }\r\n\r\nNavigator.push(\"myapp://user/123\")\r\nNavigator.present(\"myapp://user/123\")\r\nNavigator.open(\"myapp://alert?title=Hi\")\r\n```\r\n\r\nExample for multiple navigators:\r\n\r\n```swift\r\nlet facebookNavigator = URLNavigator()\r\nfacebookNavigator.scheme = \"fb\"\r\nfacebookNavigator.map(\"/post/<id>\", PostViewController.self) // \"fb://post/<id>\"\r\n\r\nlet instagramNavigator = URLNavigator()\r\ninstagramNavigator.scheme = \"instagram\"\r\ninstagramNavigator.map(\"/post/<id>\", PostViewController.self) // \"instagram://post/<id>\"\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/devxoul/URLNavigator/issues/comments/213386204","html_url":"https://github.com/devxoul/URLNavigator/pull/11#issuecomment-213386204","issue_url":"https://api.github.com/repos/devxoul/URLNavigator/issues/11","id":213386204,"user":{"login":"devxoul","id":931655,"avatar_url":"https://avatars.githubusercontent.com/u/931655?v=3","gravatar_id":"","url":"https://api.github.com/users/devxoul","html_url":"https://github.com/devxoul","followers_url":"https://api.github.com/users/devxoul/followers","following_url":"https://api.github.com/users/devxoul/following{/other_user}","gists_url":"https://api.github.com/users/devxoul/gists{/gist_id}","starred_url":"https://api.github.com/users/devxoul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devxoul/subscriptions","organizations_url":"https://api.github.com/users/devxoul/orgs","repos_url":"https://api.github.com/users/devxoul/repos","events_url":"https://api.github.com/users/devxoul/events{/privacy}","received_events_url":"https://api.github.com/users/devxoul/received_events","type":"User","site_admin":false},"created_at":"2016-04-22T11:26:41Z","updated_at":"2016-04-22T11:26:41Z","body":"Totally agree with code duplications. But, why I want to keep `normalizedURL()` static method is to make utility functions context-free. If `normalizedURL()` become instance method, this will have context of its instance properties that may cause unexpected output.\r\n\r\nHow about providing `scheme` as a parameter of `normalizedURL`?"}}