{"action":"created","comment":{"url":"https://api.github.com/repos/mattrubin/Authenticator/pulls/comments/48557555","id":48557555,"diff_hunk":"@@ -76,21 +68,20 @@ class SegmentedControlRowCell<ViewModel: SegmentedControlRowModel>: UITableViewC\n             let segment = viewModel.segments[i]\n             segmentedControl.insertSegmentWithTitle(segment.title, atIndex: i, animated: false)\n         }\n-        // Store values\n-        values = viewModel.segments.map { $0.value }\n-        // Select the initial value\n-        segmentedControl.selectedSegmentIndex = values.indexOf(viewModel.value) ?? 0\n+        // Store the action associated with each segment\n+        actions = viewModel.segments.map({ $0.action })\n+        // Select the initial segment\n+        segmentedControl.selectedSegmentIndex = viewModel.selectedSegmentIndex ?? UISegmentedControlNoSegment","path":"Authenticator/Source/SegmentedControlRowCell.swift","position":43,"original_position":43,"commit_id":"c7c8642877fbd07ac39ec5c7711fc072244d6d21","original_commit_id":"fa9a709fb3d244d63729a5e6f97356ded4ac34d6","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":"Line Length Violation: Line should be 100 characters or less: currently 109 characters (line_length)","created_at":"2015-12-29T17:58:10Z","updated_at":"2015-12-29T17:58:10Z","html_url":"https://github.com/mattrubin/Authenticator/pull/72#discussion_r48557555","pull_request_url":"https://api.github.com/repos/mattrubin/Authenticator/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/mattrubin/Authenticator/pulls/comments/48557555"},"html":{"href":"https://github.com/mattrubin/Authenticator/pull/72#discussion_r48557555"},"pull_request":{"href":"https://api.github.com/repos/mattrubin/Authenticator/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/mattrubin/Authenticator/pulls/72","id":54693264,"html_url":"https://github.com/mattrubin/Authenticator/pull/72","diff_url":"https://github.com/mattrubin/Authenticator/pull/72.diff","patch_url":"https://github.com/mattrubin/Authenticator/pull/72.patch","issue_url":"https://api.github.com/repos/mattrubin/Authenticator/issues/72","number":72,"state":"closed","locked":false,"title":"Segmented control rows","user":{"login":"mattrubin","id":532638,"avatar_url":"https://avatars.githubusercontent.com/u/532638?v=3","gravatar_id":"","url":"https://api.github.com/users/mattrubin","html_url":"https://github.com/mattrubin","followers_url":"https://api.github.com/users/mattrubin/followers","following_url":"https://api.github.com/users/mattrubin/following{/other_user}","gists_url":"https://api.github.com/users/mattrubin/gists{/gist_id}","starred_url":"https://api.github.com/users/mattrubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattrubin/subscriptions","organizations_url":"https://api.github.com/users/mattrubin/orgs","repos_url":"https://api.github.com/users/mattrubin/repos","events_url":"https://api.github.com/users/mattrubin/events{/privacy}","received_events_url":"https://api.github.com/users/mattrubin/received_events","type":"User","site_admin":false},"body":"This PR re-genericizes `SegmentedControlRowCell` on the type of `Action` dispatched when a segment is selected. It also simplifies `SegmentedControlRowModel` to not expose raw values, and to expose instead a title and action for each segment and a selected segment index. The values represented by the segments become a private detail of the row models, and the values are wrapped in a change action before being passed to the cell.","created_at":"2015-12-29T00:00:42Z","updated_at":"2015-12-29T17:58:11Z","closed_at":"2015-12-29T00:18:15Z","merged_at":"2015-12-29T00:18:15Z","merge_commit_sha":"d12b57e848c1606edf9805ac0e871beaecea704d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mattrubin/Authenticator/pulls/72/commits","review_comments_url":"https://api.github.com/repos/mattrubin/Authenticator/pulls/72/comments","review_comment_url":"https://api.github.com/repos/mattrubin/Authenticator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mattrubin/Authenticator/issues/72/comments","statuses_url":"https://api.github.com/repos/mattrubin/Authenticator/statuses/c7c8642877fbd07ac39ec5c7711fc072244d6d21","head":{"label":"mattrubin:segmented-control-rows","ref":"segmented-control-rows","sha":"c7c8642877fbd07ac39ec5c7711fc072244d6d21","user":{"login":"mattrubin","id":532638,"avatar_url":"https://avatars.githubusercontent.com/u/532638?v=3","gravatar_id":"","url":"https://api.github.com/users/mattrubin","html_url":"https://github.com/mattrubin","followers_url":"https://api.github.com/users/mattrubin/followers","following_url":"https://api.github.com/users/mattrubin/following{/other_user}","gists_url":"https://api.github.com/users/mattrubin/gists{/gist_id}","starred_url":"https://api.github.com/users/mattrubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattrubin/subscriptions","organizations_url":"https://api.github.com/users/mattrubin/orgs","repos_url":"https://api.github.com/users/mattrubin/repos","events_url":"https://api.github.com/users/mattrubin/events{/privacy}","received_events_url":"https://api.github.com/users/mattrubin/received_events","type":"User","site_admin":false},"repo":{"id":12443591,"name":"Authenticator","full_name":"mattrubin/Authenticator","owner":{"login":"mattrubin","id":532638,"avatar_url":"https://avatars.githubusercontent.com/u/532638?v=3","gravatar_id":"","url":"https://api.github.com/users/mattrubin","html_url":"https://github.com/mattrubin","followers_url":"https://api.github.com/users/mattrubin/followers","following_url":"https://api.github.com/users/mattrubin/following{/other_user}","gists_url":"https://api.github.com/users/mattrubin/gists{/gist_id}","starred_url":"https://api.github.com/users/mattrubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattrubin/subscriptions","organizations_url":"https://api.github.com/users/mattrubin/orgs","repos_url":"https://api.github.com/users/mattrubin/repos","events_url":"https://api.github.com/users/mattrubin/events{/privacy}","received_events_url":"https://api.github.com/users/mattrubin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattrubin/Authenticator","description":"Two-Factor Authentication Client for iOS","fork":false,"url":"https://api.github.com/repos/mattrubin/Authenticator","forks_url":"https://api.github.com/repos/mattrubin/Authenticator/forks","keys_url":"https://api.github.com/repos/mattrubin/Authenticator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattrubin/Authenticator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattrubin/Authenticator/teams","hooks_url":"https://api.github.com/repos/mattrubin/Authenticator/hooks","issue_events_url":"https://api.github.com/repos/mattrubin/Authenticator/issues/events{/number}","events_url":"https://api.github.com/repos/mattrubin/Authenticator/events","assignees_url":"https://api.github.com/repos/mattrubin/Authenticator/assignees{/user}","branches_url":"https://api.github.com/repos/mattrubin/Authenticator/branches{/branch}","tags_url":"https://api.github.com/repos/mattrubin/Authenticator/tags","blobs_url":"https://api.github.com/repos/mattrubin/Authenticator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattrubin/Authenticator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattrubin/Authenticator/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattrubin/Authenticator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattrubin/Authenticator/statuses/{sha}","languages_url":"https://api.github.com/repos/mattrubin/Authenticator/languages","stargazers_url":"https://api.github.com/repos/mattrubin/Authenticator/stargazers","contributors_url":"https://api.github.com/repos/mattrubin/Authenticator/contributors","subscribers_url":"https://api.github.com/repos/mattrubin/Authenticator/subscribers","subscription_url":"https://api.github.com/repos/mattrubin/Authenticator/subscription","commits_url":"https://api.github.com/repos/mattrubin/Authenticator/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattrubin/Authenticator/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattrubin/Authenticator/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattrubin/Authenticator/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattrubin/Authenticator/contents/{+path}","compare_url":"https://api.github.com/repos/mattrubin/Authenticator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattrubin/Authenticator/merges","archive_url":"https://api.github.com/repos/mattrubin/Authenticator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattrubin/Authenticator/downloads","issues_url":"https://api.github.com/repos/mattrubin/Authenticator/issues{/number}","pulls_url":"https://api.github.com/repos/mattrubin/Authenticator/pulls{/number}","milestones_url":"https://api.github.com/repos/mattrubin/Authenticator/milestones{/number}","notifications_url":"https://api.github.com/repos/mattrubin/Authenticator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattrubin/Authenticator/labels{/name}","releases_url":"https://api.github.com/repos/mattrubin/Authenticator/releases{/id}","created_at":"2013-08-28T20:15:05Z","updated_at":"2015-12-24T09:11:54Z","pushed_at":"2015-12-29T06:21:04Z","git_url":"git://github.com/mattrubin/Authenticator.git","ssh_url":"git@github.com:mattrubin/Authenticator.git","clone_url":"https://github.com/mattrubin/Authenticator.git","svn_url":"https://github.com/mattrubin/Authenticator","homepage":"mattrubin.me/authenticator","size":15416,"stargazers_count":81,"watchers_count":81,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":12,"mirror_url":null,"open_issues_count":8,"forks":12,"open_issues":8,"watchers":81,"default_branch":"master"}},"base":{"label":"mattrubin:master","ref":"master","sha":"89f6057108c696323e7da2b6efff523eada6445d","user":{"login":"mattrubin","id":532638,"avatar_url":"https://avatars.githubusercontent.com/u/532638?v=3","gravatar_id":"","url":"https://api.github.com/users/mattrubin","html_url":"https://github.com/mattrubin","followers_url":"https://api.github.com/users/mattrubin/followers","following_url":"https://api.github.com/users/mattrubin/following{/other_user}","gists_url":"https://api.github.com/users/mattrubin/gists{/gist_id}","starred_url":"https://api.github.com/users/mattrubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattrubin/subscriptions","organizations_url":"https://api.github.com/users/mattrubin/orgs","repos_url":"https://api.github.com/users/mattrubin/repos","events_url":"https://api.github.com/users/mattrubin/events{/privacy}","received_events_url":"https://api.github.com/users/mattrubin/received_events","type":"User","site_admin":false},"repo":{"id":12443591,"name":"Authenticator","full_name":"mattrubin/Authenticator","owner":{"login":"mattrubin","id":532638,"avatar_url":"https://avatars.githubusercontent.com/u/532638?v=3","gravatar_id":"","url":"https://api.github.com/users/mattrubin","html_url":"https://github.com/mattrubin","followers_url":"https://api.github.com/users/mattrubin/followers","following_url":"https://api.github.com/users/mattrubin/following{/other_user}","gists_url":"https://api.github.com/users/mattrubin/gists{/gist_id}","starred_url":"https://api.github.com/users/mattrubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattrubin/subscriptions","organizations_url":"https://api.github.com/users/mattrubin/orgs","repos_url":"https://api.github.com/users/mattrubin/repos","events_url":"https://api.github.com/users/mattrubin/events{/privacy}","received_events_url":"https://api.github.com/users/mattrubin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattrubin/Authenticator","description":"Two-Factor Authentication Client for iOS","fork":false,"url":"https://api.github.com/repos/mattrubin/Authenticator","forks_url":"https://api.github.com/repos/mattrubin/Authenticator/forks","keys_url":"https://api.github.com/repos/mattrubin/Authenticator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattrubin/Authenticator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattrubin/Authenticator/teams","hooks_url":"https://api.github.com/repos/mattrubin/Authenticator/hooks","issue_events_url":"https://api.github.com/repos/mattrubin/Authenticator/issues/events{/number}","events_url":"https://api.github.com/repos/mattrubin/Authenticator/events","assignees_url":"https://api.github.com/repos/mattrubin/Authenticator/assignees{/user}","branches_url":"https://api.github.com/repos/mattrubin/Authenticator/branches{/branch}","tags_url":"https://api.github.com/repos/mattrubin/Authenticator/tags","blobs_url":"https://api.github.com/repos/mattrubin/Authenticator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattrubin/Authenticator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattrubin/Authenticator/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattrubin/Authenticator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattrubin/Authenticator/statuses/{sha}","languages_url":"https://api.github.com/repos/mattrubin/Authenticator/languages","stargazers_url":"https://api.github.com/repos/mattrubin/Authenticator/stargazers","contributors_url":"https://api.github.com/repos/mattrubin/Authenticator/contributors","subscribers_url":"https://api.github.com/repos/mattrubin/Authenticator/subscribers","subscription_url":"https://api.github.com/repos/mattrubin/Authenticator/subscription","commits_url":"https://api.github.com/repos/mattrubin/Authenticator/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattrubin/Authenticator/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattrubin/Authenticator/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattrubin/Authenticator/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattrubin/Authenticator/contents/{+path}","compare_url":"https://api.github.com/repos/mattrubin/Authenticator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattrubin/Authenticator/merges","archive_url":"https://api.github.com/repos/mattrubin/Authenticator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattrubin/Authenticator/downloads","issues_url":"https://api.github.com/repos/mattrubin/Authenticator/issues{/number}","pulls_url":"https://api.github.com/repos/mattrubin/Authenticator/pulls{/number}","milestones_url":"https://api.github.com/repos/mattrubin/Authenticator/milestones{/number}","notifications_url":"https://api.github.com/repos/mattrubin/Authenticator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattrubin/Authenticator/labels{/name}","releases_url":"https://api.github.com/repos/mattrubin/Authenticator/releases{/id}","created_at":"2013-08-28T20:15:05Z","updated_at":"2015-12-24T09:11:54Z","pushed_at":"2015-12-29T06:21:04Z","git_url":"git://github.com/mattrubin/Authenticator.git","ssh_url":"git@github.com:mattrubin/Authenticator.git","clone_url":"https://github.com/mattrubin/Authenticator.git","svn_url":"https://github.com/mattrubin/Authenticator","homepage":"mattrubin.me/authenticator","size":15416,"stargazers_count":81,"watchers_count":81,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":12,"mirror_url":null,"open_issues_count":8,"forks":12,"open_issues":8,"watchers":81,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattrubin/Authenticator/pulls/72"},"html":{"href":"https://github.com/mattrubin/Authenticator/pull/72"},"issue":{"href":"https://api.github.com/repos/mattrubin/Authenticator/issues/72"},"comments":{"href":"https://api.github.com/repos/mattrubin/Authenticator/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/mattrubin/Authenticator/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/mattrubin/Authenticator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mattrubin/Authenticator/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/mattrubin/Authenticator/statuses/c7c8642877fbd07ac39ec5c7711fc072244d6d21"}}}}