{"action":"created","comment":{"url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/pulls/comments/43571797","id":43571797,"diff_hunk":"@@ -117,11 +130,107 @@ class ConferenceTableViewController: UITableViewController, MKMapViewDelegate {\n \n         let theSpan:MKCoordinateSpan = MKCoordinateSpanMake(latDelta, longDelta)\n         let venueLocation:CLLocationCoordinate2D = CLLocationCoordinate2DMake(latitude, longitude)\n-                let theRegion:MKCoordinateRegion = MKCoordinateRegionMake(venueLocation, theSpan)\n-\n+        let theRegion:MKCoordinateRegion = MKCoordinateRegionMake(venueLocation, theSpan)\n+        \n         return theRegion\n     }\n-\n+    \n+    func setTapGestureOnDateImage() {\n+        let tapGesture = UITapGestureRecognizer()\n+        tapGesture.numberOfTapsRequired = 1\n+        tapGesture.addTarget(self, action: \"tapOnDateImageHandler:\")\n+        dateImage.addGestureRecognizer(tapGesture)\n+    }\n+    \n+    func tapOnDateImageHandler(sender: UITapGestureRecognizer) {\n+        let eventStore = EKEventStore()\n+        \n+        eventStore.requestAccessToEntityType(EKEntityType.Event, completion: {\n+            granted, error in\n+            if (granted) && (error == nil) {\n+                if self.calendarEventID.isEmpty {\n+                     dispatch_async(dispatch_get_main_queue()) {\n+                        self.addCalendarEventtoStore(eventStore)\n+                    }\n+                    \n+                } else { // Event Already present in calendar.\n+                    dispatch_async(dispatch_get_main_queue()) {\n+                        self.deleteEventFromStore(eventStore, eventID:self.calendarEventID)\n+                    }\n+                }\n+            }\n+        })\n+        \n+    }\n+    \n+    func addCalendarEventtoStore(eventStore:EKEventStore) {\n+        let event:EKEvent = EKEvent(eventStore: eventStore)\n+        event.title = self.conferenceName\n+        event.startDate = self.startDate\n+        event.endDate = self.endDate\n+        event.location = self.locationLabel.text\n+        event.allDay = true\n+        // event.notes = \"Note for conference\"\n+        \n+        event.calendar = eventStore.defaultCalendarForNewEvents\n+        \n+        let alertController = UIAlertController(title: \"Create Event.\",\n+            message: \"Create Event in Calender ?\", preferredStyle: .Alert)\n+        \n+        let createAction = UIAlertAction(title: \"Create\", style: .Default) { (action) -> Void in\n+            do {\n+                try eventStore.saveEvent(event, span: EKSpan.ThisEvent, commit: true)\n+                self.calendarEventID = event.eventIdentifier\n+                \n+                self.conferenceDataStore?.updateCalendarEventIdentifier(self.conference,\n+                    eventId:event.eventIdentifier)\n+            } catch {\n+                print(\"Failed to create an event in Calendar.\")\n+            }\n+        }\n+        \n+        let cancelAction = UIAlertAction(title: \"Cancel\", style: .Default, handler:nil )\n+        \n+        alertController.addAction(createAction)\n+        alertController.addAction(cancelAction)\n+        \n+        self.presentViewController(alertController, animated: true, completion: nil)\n+    }\n+    \n+    func deleteEventFromStore( eventStore:EKEventStore, eventID: String) {","path":"ConferencesApp/ConferenceTableViewController.swift","position":110,"original_position":110,"commit_id":"49dc341706082053e79cfa1c7e57467e50dbc2d4","original_commit_id":"49dc341706082053e79cfa1c7e57467e50dbc2d4","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Colon Violation: When specifying a type, always associate the colon with the identifier","created_at":"2015-10-31T13:44:47Z","updated_at":"2015-10-31T13:44:47Z","html_url":"https://github.com/conferencesapp/rubyconferences-ios/pull/28#discussion_r43571797","pull_request_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/pulls/comments/43571797"},"html":{"href":"https://github.com/conferencesapp/rubyconferences-ios/pull/28#discussion_r43571797"},"pull_request":{"href":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/pulls/28","id":49345198,"html_url":"https://github.com/conferencesapp/rubyconferences-ios/pull/28","diff_url":"https://github.com/conferencesapp/rubyconferences-ios/pull/28.diff","patch_url":"https://github.com/conferencesapp/rubyconferences-ios/pull/28.patch","issue_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/issues/28","number":28,"state":"open","locked":false,"title":"issue #25 - create, delete calendar event for conference ","user":{"login":"ihemantd","id":5268513,"avatar_url":"https://avatars.githubusercontent.com/u/5268513?v=3","gravatar_id":"","url":"https://api.github.com/users/ihemantd","html_url":"https://github.com/ihemantd","followers_url":"https://api.github.com/users/ihemantd/followers","following_url":"https://api.github.com/users/ihemantd/following{/other_user}","gists_url":"https://api.github.com/users/ihemantd/gists{/gist_id}","starred_url":"https://api.github.com/users/ihemantd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ihemantd/subscriptions","organizations_url":"https://api.github.com/users/ihemantd/orgs","repos_url":"https://api.github.com/users/ihemantd/repos","events_url":"https://api.github.com/users/ihemantd/events{/privacy}","received_events_url":"https://api.github.com/users/ihemantd/received_events","type":"User","site_admin":false},"body":"Please review the commit.\r\nThanks,","created_at":"2015-10-31T08:57:20Z","updated_at":"2015-10-31T13:44:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cfbec7d58c79a15909cbf091e95d1d218f9295bc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/pulls/28/commits","review_comments_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/pulls/28/comments","review_comment_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/issues/28/comments","statuses_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/statuses/49dc341706082053e79cfa1c7e57467e50dbc2d4","head":{"label":"ihemantd:feature-#25-Create-an-event-in-calendar","ref":"feature-#25-Create-an-event-in-calendar","sha":"49dc341706082053e79cfa1c7e57467e50dbc2d4","user":{"login":"ihemantd","id":5268513,"avatar_url":"https://avatars.githubusercontent.com/u/5268513?v=3","gravatar_id":"","url":"https://api.github.com/users/ihemantd","html_url":"https://github.com/ihemantd","followers_url":"https://api.github.com/users/ihemantd/followers","following_url":"https://api.github.com/users/ihemantd/following{/other_user}","gists_url":"https://api.github.com/users/ihemantd/gists{/gist_id}","starred_url":"https://api.github.com/users/ihemantd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ihemantd/subscriptions","organizations_url":"https://api.github.com/users/ihemantd/orgs","repos_url":"https://api.github.com/users/ihemantd/repos","events_url":"https://api.github.com/users/ihemantd/events{/privacy}","received_events_url":"https://api.github.com/users/ihemantd/received_events","type":"User","site_admin":false},"repo":{"id":43547416,"name":"rubyconferences-ios","full_name":"ihemantd/rubyconferences-ios","owner":{"login":"ihemantd","id":5268513,"avatar_url":"https://avatars.githubusercontent.com/u/5268513?v=3","gravatar_id":"","url":"https://api.github.com/users/ihemantd","html_url":"https://github.com/ihemantd","followers_url":"https://api.github.com/users/ihemantd/followers","following_url":"https://api.github.com/users/ihemantd/following{/other_user}","gists_url":"https://api.github.com/users/ihemantd/gists{/gist_id}","starred_url":"https://api.github.com/users/ihemantd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ihemantd/subscriptions","organizations_url":"https://api.github.com/users/ihemantd/orgs","repos_url":"https://api.github.com/users/ihemantd/repos","events_url":"https://api.github.com/users/ihemantd/events{/privacy}","received_events_url":"https://api.github.com/users/ihemantd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ihemantd/rubyconferences-ios","description":"iOS app for rubyconferences app","fork":true,"url":"https://api.github.com/repos/ihemantd/rubyconferences-ios","forks_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/forks","keys_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/teams","hooks_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/hooks","issue_events_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/issues/events{/number}","events_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/events","assignees_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/assignees{/user}","branches_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/branches{/branch}","tags_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/tags","blobs_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/languages","stargazers_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/stargazers","contributors_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/contributors","subscribers_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/subscribers","subscription_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/subscription","commits_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/contents/{+path}","compare_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/merges","archive_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/downloads","issues_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/issues{/number}","pulls_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/labels{/name}","releases_url":"https://api.github.com/repos/ihemantd/rubyconferences-ios/releases{/id}","created_at":"2015-10-02T10:34:27Z","updated_at":"2015-10-02T10:34:28Z","pushed_at":"2015-10-31T13:44:34Z","git_url":"git://github.com/ihemantd/rubyconferences-ios.git","ssh_url":"git@github.com:ihemantd/rubyconferences-ios.git","clone_url":"https://github.com/ihemantd/rubyconferences-ios.git","svn_url":"https://github.com/ihemantd/rubyconferences-ios","homepage":"https://appsto.re/in/Ff9e7.i","size":433,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"conferencesapp:master","ref":"master","sha":"70b5a12752f264f46e7700710585e4f075a54ffe","user":{"login":"conferencesapp","id":12842499,"avatar_url":"https://avatars.githubusercontent.com/u/12842499?v=3","gravatar_id":"","url":"https://api.github.com/users/conferencesapp","html_url":"https://github.com/conferencesapp","followers_url":"https://api.github.com/users/conferencesapp/followers","following_url":"https://api.github.com/users/conferencesapp/following{/other_user}","gists_url":"https://api.github.com/users/conferencesapp/gists{/gist_id}","starred_url":"https://api.github.com/users/conferencesapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conferencesapp/subscriptions","organizations_url":"https://api.github.com/users/conferencesapp/orgs","repos_url":"https://api.github.com/users/conferencesapp/repos","events_url":"https://api.github.com/users/conferencesapp/events{/privacy}","received_events_url":"https://api.github.com/users/conferencesapp/received_events","type":"Organization","site_admin":false},"repo":{"id":36131792,"name":"rubyconferences-ios","full_name":"conferencesapp/rubyconferences-ios","owner":{"login":"conferencesapp","id":12842499,"avatar_url":"https://avatars.githubusercontent.com/u/12842499?v=3","gravatar_id":"","url":"https://api.github.com/users/conferencesapp","html_url":"https://github.com/conferencesapp","followers_url":"https://api.github.com/users/conferencesapp/followers","following_url":"https://api.github.com/users/conferencesapp/following{/other_user}","gists_url":"https://api.github.com/users/conferencesapp/gists{/gist_id}","starred_url":"https://api.github.com/users/conferencesapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conferencesapp/subscriptions","organizations_url":"https://api.github.com/users/conferencesapp/orgs","repos_url":"https://api.github.com/users/conferencesapp/repos","events_url":"https://api.github.com/users/conferencesapp/events{/privacy}","received_events_url":"https://api.github.com/users/conferencesapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/conferencesapp/rubyconferences-ios","description":"iOS app for rubyconferences app","fork":false,"url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios","forks_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/forks","keys_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/teams","hooks_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/hooks","issue_events_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/issues/events{/number}","events_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/events","assignees_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/assignees{/user}","branches_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/branches{/branch}","tags_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/tags","blobs_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/languages","stargazers_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/stargazers","contributors_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/contributors","subscribers_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/subscribers","subscription_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/subscription","commits_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/contents/{+path}","compare_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/merges","archive_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/downloads","issues_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/issues{/number}","pulls_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/labels{/name}","releases_url":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/releases{/id}","created_at":"2015-05-23T16:28:54Z","updated_at":"2015-09-30T13:51:15Z","pushed_at":"2015-10-31T13:44:34Z","git_url":"git://github.com/conferencesapp/rubyconferences-ios.git","ssh_url":"git@github.com:conferencesapp/rubyconferences-ios.git","clone_url":"https://github.com/conferencesapp/rubyconferences-ios.git","svn_url":"https://github.com/conferencesapp/rubyconferences-ios","homepage":"https://appsto.re/in/Ff9e7.i","size":741,"stargazers_count":22,"watchers_count":22,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":8,"forks":2,"open_issues":8,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/pulls/28"},"html":{"href":"https://github.com/conferencesapp/rubyconferences-ios/pull/28"},"issue":{"href":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/issues/28"},"comments":{"href":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/conferencesapp/rubyconferences-ios/statuses/49dc341706082053e79cfa1c7e57467e50dbc2d4"}}}}