{"action":"created","comment":{"url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/pulls/comments/36869116","id":36869116,"diff_hunk":"@@ -22,55 +34,113 @@ public class IJReachability {\n     */\n     public class func isConnectedToNetwork() -> Bool {\n         \n-        var zeroAddress = sockaddr_in(sin_len: 0, sin_family: 0, sin_port: 0, sin_addr: in_addr(s_addr: 0), sin_zero: (0, 0, 0, 0, 0, 0, 0, 0))\n+        var zeroAddress = sockaddr_in()\n         zeroAddress.sin_len = UInt8(sizeofValue(zeroAddress))\n         zeroAddress.sin_family = sa_family_t(AF_INET)\n-        \n-        let defaultRouteReachability = withUnsafePointer(&zeroAddress) {\n-            SCNetworkReachabilityCreateWithAddress(nil, UnsafePointer($0)).takeRetainedValue()\n+\n+        guard let defaultRouteReachability = withUnsafePointer(&zeroAddress, {\n+            SCNetworkReachabilityCreateWithAddress(nil, UnsafePointer($0))\n+        }) else {\n+            return false\n         }\n         \n-        var flags: SCNetworkReachabilityFlags = 0\n+        var flags : SCNetworkReachabilityFlags = []\n+        \n         if SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags) == 0 {","path":"IJReachability/IJReachability/IJReachability.swift","position":40,"original_position":40,"commit_id":"aca1188e7f8029fa7236e401c22f6bba04341206","original_commit_id":"aca1188e7f8029fa7236e401c22f6bba04341206","user":{"login":"Tuslareb","id":6486085,"avatar_url":"https://avatars.githubusercontent.com/u/6486085?v=3","gravatar_id":"","url":"https://api.github.com/users/Tuslareb","html_url":"https://github.com/Tuslareb","followers_url":"https://api.github.com/users/Tuslareb/followers","following_url":"https://api.github.com/users/Tuslareb/following{/other_user}","gists_url":"https://api.github.com/users/Tuslareb/gists{/gist_id}","starred_url":"https://api.github.com/users/Tuslareb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tuslareb/subscriptions","organizations_url":"https://api.github.com/users/Tuslareb/orgs","repos_url":"https://api.github.com/users/Tuslareb/repos","events_url":"https://api.github.com/users/Tuslareb/events{/privacy}","received_events_url":"https://api.github.com/users/Tuslareb/received_events","type":"User","site_admin":false},"body":"I get the error: Binary operator '==' cannot be applied to operands of type 'Bool' and 'Int' on beta 5. Error went away by replacing 0 by 'false', or when replacing the code to:  \r\n\r\nif !SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags) { return false }","created_at":"2015-08-12T14:53:23Z","updated_at":"2015-08-12T14:53:23Z","html_url":"https://github.com/Isuru-Nanayakkara/IJReachability/pull/11#discussion_r36869116","pull_request_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/pulls/comments/36869116"},"html":{"href":"https://github.com/Isuru-Nanayakkara/IJReachability/pull/11#discussion_r36869116"},"pull_request":{"href":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/pulls/11","id":39441035,"html_url":"https://github.com/Isuru-Nanayakkara/IJReachability/pull/11","diff_url":"https://github.com/Isuru-Nanayakkara/IJReachability/pull/11.diff","patch_url":"https://github.com/Isuru-Nanayakkara/IJReachability/pull/11.patch","issue_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/issues/11","number":11,"state":"open","locked":false,"title":"Upgrade to Swift 2. Add notifications for network status changes.","user":{"login":"danwallacenz","id":1234852,"avatar_url":"https://avatars.githubusercontent.com/u/1234852?v=3","gravatar_id":"","url":"https://api.github.com/users/danwallacenz","html_url":"https://github.com/danwallacenz","followers_url":"https://api.github.com/users/danwallacenz/followers","following_url":"https://api.github.com/users/danwallacenz/following{/other_user}","gists_url":"https://api.github.com/users/danwallacenz/gists{/gist_id}","starred_url":"https://api.github.com/users/danwallacenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danwallacenz/subscriptions","organizations_url":"https://api.github.com/users/danwallacenz/orgs","repos_url":"https://api.github.com/users/danwallacenz/repos","events_url":"https://api.github.com/users/danwallacenz/events{/privacy}","received_events_url":"https://api.github.com/users/danwallacenz/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-08T04:39:15Z","updated_at":"2015-08-12T14:53:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7f07cbaa92b501cd853776bfe0f6fd086f2e6472","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/pulls/11/commits","review_comments_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/pulls/11/comments","review_comment_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/issues/11/comments","statuses_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/statuses/aca1188e7f8029fa7236e401c22f6bba04341206","head":{"label":"danwallacenz:swift2-with-autodetect","ref":"swift2-with-autodetect","sha":"aca1188e7f8029fa7236e401c22f6bba04341206","user":{"login":"danwallacenz","id":1234852,"avatar_url":"https://avatars.githubusercontent.com/u/1234852?v=3","gravatar_id":"","url":"https://api.github.com/users/danwallacenz","html_url":"https://github.com/danwallacenz","followers_url":"https://api.github.com/users/danwallacenz/followers","following_url":"https://api.github.com/users/danwallacenz/following{/other_user}","gists_url":"https://api.github.com/users/danwallacenz/gists{/gist_id}","starred_url":"https://api.github.com/users/danwallacenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danwallacenz/subscriptions","organizations_url":"https://api.github.com/users/danwallacenz/orgs","repos_url":"https://api.github.com/users/danwallacenz/repos","events_url":"https://api.github.com/users/danwallacenz/events{/privacy}","received_events_url":"https://api.github.com/users/danwallacenz/received_events","type":"User","site_admin":false},"repo":{"id":38731436,"name":"IJReachability","full_name":"danwallacenz/IJReachability","owner":{"login":"danwallacenz","id":1234852,"avatar_url":"https://avatars.githubusercontent.com/u/1234852?v=3","gravatar_id":"","url":"https://api.github.com/users/danwallacenz","html_url":"https://github.com/danwallacenz","followers_url":"https://api.github.com/users/danwallacenz/followers","following_url":"https://api.github.com/users/danwallacenz/following{/other_user}","gists_url":"https://api.github.com/users/danwallacenz/gists{/gist_id}","starred_url":"https://api.github.com/users/danwallacenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danwallacenz/subscriptions","organizations_url":"https://api.github.com/users/danwallacenz/orgs","repos_url":"https://api.github.com/users/danwallacenz/repos","events_url":"https://api.github.com/users/danwallacenz/events{/privacy}","received_events_url":"https://api.github.com/users/danwallacenz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danwallacenz/IJReachability","description":"A simple class to check for internet connection availability in Swift.","fork":true,"url":"https://api.github.com/repos/danwallacenz/IJReachability","forks_url":"https://api.github.com/repos/danwallacenz/IJReachability/forks","keys_url":"https://api.github.com/repos/danwallacenz/IJReachability/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danwallacenz/IJReachability/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danwallacenz/IJReachability/teams","hooks_url":"https://api.github.com/repos/danwallacenz/IJReachability/hooks","issue_events_url":"https://api.github.com/repos/danwallacenz/IJReachability/issues/events{/number}","events_url":"https://api.github.com/repos/danwallacenz/IJReachability/events","assignees_url":"https://api.github.com/repos/danwallacenz/IJReachability/assignees{/user}","branches_url":"https://api.github.com/repos/danwallacenz/IJReachability/branches{/branch}","tags_url":"https://api.github.com/repos/danwallacenz/IJReachability/tags","blobs_url":"https://api.github.com/repos/danwallacenz/IJReachability/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danwallacenz/IJReachability/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danwallacenz/IJReachability/git/refs{/sha}","trees_url":"https://api.github.com/repos/danwallacenz/IJReachability/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danwallacenz/IJReachability/statuses/{sha}","languages_url":"https://api.github.com/repos/danwallacenz/IJReachability/languages","stargazers_url":"https://api.github.com/repos/danwallacenz/IJReachability/stargazers","contributors_url":"https://api.github.com/repos/danwallacenz/IJReachability/contributors","subscribers_url":"https://api.github.com/repos/danwallacenz/IJReachability/subscribers","subscription_url":"https://api.github.com/repos/danwallacenz/IJReachability/subscription","commits_url":"https://api.github.com/repos/danwallacenz/IJReachability/commits{/sha}","git_commits_url":"https://api.github.com/repos/danwallacenz/IJReachability/git/commits{/sha}","comments_url":"https://api.github.com/repos/danwallacenz/IJReachability/comments{/number}","issue_comment_url":"https://api.github.com/repos/danwallacenz/IJReachability/issues/comments{/number}","contents_url":"https://api.github.com/repos/danwallacenz/IJReachability/contents/{+path}","compare_url":"https://api.github.com/repos/danwallacenz/IJReachability/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danwallacenz/IJReachability/merges","archive_url":"https://api.github.com/repos/danwallacenz/IJReachability/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danwallacenz/IJReachability/downloads","issues_url":"https://api.github.com/repos/danwallacenz/IJReachability/issues{/number}","pulls_url":"https://api.github.com/repos/danwallacenz/IJReachability/pulls{/number}","milestones_url":"https://api.github.com/repos/danwallacenz/IJReachability/milestones{/number}","notifications_url":"https://api.github.com/repos/danwallacenz/IJReachability/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danwallacenz/IJReachability/labels{/name}","releases_url":"https://api.github.com/repos/danwallacenz/IJReachability/releases{/id}","created_at":"2015-07-08T04:16:21Z","updated_at":"2015-07-26T05:27:07Z","pushed_at":"2015-07-08T04:36:35Z","git_url":"git://github.com/danwallacenz/IJReachability.git","ssh_url":"git@github.com:danwallacenz/IJReachability.git","clone_url":"https://github.com/danwallacenz/IJReachability.git","svn_url":"https://github.com/danwallacenz/IJReachability","homepage":null,"size":126,"stargazers_count":1,"watchers_count":1,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"Isuru-Nanayakkara:master","ref":"master","sha":"da69c8f4bed9f82203bb49180fb36091b4cd0d28","user":{"login":"Isuru-Nanayakkara","id":2551877,"avatar_url":"https://avatars.githubusercontent.com/u/2551877?v=3","gravatar_id":"","url":"https://api.github.com/users/Isuru-Nanayakkara","html_url":"https://github.com/Isuru-Nanayakkara","followers_url":"https://api.github.com/users/Isuru-Nanayakkara/followers","following_url":"https://api.github.com/users/Isuru-Nanayakkara/following{/other_user}","gists_url":"https://api.github.com/users/Isuru-Nanayakkara/gists{/gist_id}","starred_url":"https://api.github.com/users/Isuru-Nanayakkara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Isuru-Nanayakkara/subscriptions","organizations_url":"https://api.github.com/users/Isuru-Nanayakkara/orgs","repos_url":"https://api.github.com/users/Isuru-Nanayakkara/repos","events_url":"https://api.github.com/users/Isuru-Nanayakkara/events{/privacy}","received_events_url":"https://api.github.com/users/Isuru-Nanayakkara/received_events","type":"User","site_admin":false},"repo":{"id":23589017,"name":"IJReachability","full_name":"Isuru-Nanayakkara/IJReachability","owner":{"login":"Isuru-Nanayakkara","id":2551877,"avatar_url":"https://avatars.githubusercontent.com/u/2551877?v=3","gravatar_id":"","url":"https://api.github.com/users/Isuru-Nanayakkara","html_url":"https://github.com/Isuru-Nanayakkara","followers_url":"https://api.github.com/users/Isuru-Nanayakkara/followers","following_url":"https://api.github.com/users/Isuru-Nanayakkara/following{/other_user}","gists_url":"https://api.github.com/users/Isuru-Nanayakkara/gists{/gist_id}","starred_url":"https://api.github.com/users/Isuru-Nanayakkara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Isuru-Nanayakkara/subscriptions","organizations_url":"https://api.github.com/users/Isuru-Nanayakkara/orgs","repos_url":"https://api.github.com/users/Isuru-Nanayakkara/repos","events_url":"https://api.github.com/users/Isuru-Nanayakkara/events{/privacy}","received_events_url":"https://api.github.com/users/Isuru-Nanayakkara/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Isuru-Nanayakkara/IJReachability","description":"A simple class to check for internet connection availability in Swift.","fork":false,"url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability","forks_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/forks","keys_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/teams","hooks_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/hooks","issue_events_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/issues/events{/number}","events_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/events","assignees_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/assignees{/user}","branches_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/branches{/branch}","tags_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/tags","blobs_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/git/refs{/sha}","trees_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/statuses/{sha}","languages_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/languages","stargazers_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/stargazers","contributors_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/contributors","subscribers_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/subscribers","subscription_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/subscription","commits_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/commits{/sha}","git_commits_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/git/commits{/sha}","comments_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/comments{/number}","issue_comment_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/issues/comments{/number}","contents_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/contents/{+path}","compare_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/merges","archive_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/downloads","issues_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/issues{/number}","pulls_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/pulls{/number}","milestones_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/milestones{/number}","notifications_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/labels{/name}","releases_url":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/releases{/id}","created_at":"2014-09-02T17:47:07Z","updated_at":"2015-08-12T10:30:00Z","pushed_at":"2015-07-08T04:39:16Z","git_url":"git://github.com/Isuru-Nanayakkara/IJReachability.git","ssh_url":"git@github.com:Isuru-Nanayakkara/IJReachability.git","clone_url":"https://github.com/Isuru-Nanayakkara/IJReachability.git","svn_url":"https://github.com/Isuru-Nanayakkara/IJReachability","homepage":null,"size":270,"stargazers_count":229,"watchers_count":229,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":4,"forks":41,"open_issues":4,"watchers":229,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/pulls/11"},"html":{"href":"https://github.com/Isuru-Nanayakkara/IJReachability/pull/11"},"issue":{"href":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/issues/11"},"comments":{"href":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/Isuru-Nanayakkara/IJReachability/statuses/aca1188e7f8029fa7236e401c22f6bba04341206"}}}}