{"action":"created","comment":{"url":"https://api.github.com/repos/wikimedia/wikipedia-ios/pulls/comments/41317488","id":41317488,"diff_hunk":"@@ -0,0 +1,167 @@\n+\n+import UIKit\n+\n+// MARK: - Cell\n+public class WMFTableOfContentsCell: UITableViewCell {\n+\n+    @IBOutlet var sectionSelectionBackground: UIView!\n+    @IBOutlet var sectionTitle: UILabel!\n+    @IBOutlet var selectedSectionIndicator: UIView!\n+    @IBOutlet var indentationConstraint: NSLayoutConstraint!\n+    @IBOutlet var leadSectionBorder: UIView!\n+    @IBOutlet var sectionBorder: UIView!\n+    \n+    // MARK: - Init\n+    public required init?(coder aDecoder: NSCoder) {\n+        section = nil\n+        super.init(coder: aDecoder);\n+        self.indentationWidth = 10\n+    }\n+    \n+    // MARK: - UIView\n+    public override func awakeFromNib() {\n+        super.awakeFromNib()\n+        self.selectedSectionIndicator.alpha = 0.0\n+        self.sectionSelectionBackground.backgroundColor = UIColor.wmf_tableOfContentsSelectionBackgroundColor()\n+        self.sectionSelectionBackground.alpha = 0.0\n+        self.selectionStyle = .None\n+    }\n+    \n+    // MARK: - Accessors\n+    public var section: MWKSection?{\n+        didSet(section) {\n+            self.sectionTitle.text = WMFTableOfContentsCell.titleText(self.section)\n+            self.sectionTitle.font = WMFTableOfContentsCell.titleFont(self.section)\n+            self.sectionTitle.textColor = WMFTableOfContentsCell.textColor(self.section)\n+            self.leadSectionBorder.hidden = !WMFTableOfContentsCell.leadSectionBorderEnabled(self.section)\n+            self.sectionBorder.hidden = !WMFTableOfContentsCell.topBorderEnabled(self.section)\n+            self.indentationConstraint.constant = WMFTableOfContentsCell.indentationWidth(self.section)\n+            self.setNeedsUpdateConstraints()\n+        }\n+    }\n+    \n+    public func setSectionSelected(selected: Bool, animated: Bool) {\n+        UIView.animateWithDuration(animated ? 0.3 : 0.0) { () -> Void in\n+            if(selected){\n+                self.sectionSelectionBackground.alpha = 1.0\n+            }else{\n+                self.sectionSelectionBackground.alpha = 0.0\n+            }\n+        }\n+    }\n+    \n+    // MARK: - UITableVIewCell\n+    public class func reuseIdentifier() -> String{\n+        return self.wmf_nibName()","path":"Wikipedia/UI-V5/WMFTableOfContentsCell.swift","position":55,"original_position":55,"commit_id":"d02a6f9710c7c87b8f2aca82eaf47ff34793eeb2","original_commit_id":"d02a6f9710c7c87b8f2aca82eaf47ff34793eeb2","user":{"login":"bgerstle","id":444217,"avatar_url":"https://avatars.githubusercontent.com/u/444217?v=3","gravatar_id":"","url":"https://api.github.com/users/bgerstle","html_url":"https://github.com/bgerstle","followers_url":"https://api.github.com/users/bgerstle/followers","following_url":"https://api.github.com/users/bgerstle/following{/other_user}","gists_url":"https://api.github.com/users/bgerstle/gists{/gist_id}","starred_url":"https://api.github.com/users/bgerstle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgerstle/subscriptions","organizations_url":"https://api.github.com/users/bgerstle/orgs","repos_url":"https://api.github.com/users/bgerstle/repos","events_url":"https://api.github.com/users/bgerstle/events{/privacy}","received_events_url":"https://api.github.com/users/bgerstle/received_events","type":"User","site_admin":false},"body":"any reason why we aren't using `wmf_nibName` directly?","created_at":"2015-10-06T20:29:09Z","updated_at":"2015-10-06T20:29:09Z","html_url":"https://github.com/wikimedia/wikipedia-ios/pull/142#discussion_r41317488","pull_request_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/pulls/142","_links":{"self":{"href":"https://api.github.com/repos/wikimedia/wikipedia-ios/pulls/comments/41317488"},"html":{"href":"https://github.com/wikimedia/wikipedia-ios/pull/142#discussion_r41317488"},"pull_request":{"href":"https://api.github.com/repos/wikimedia/wikipedia-ios/pulls/142"}}},"pull_request":{"url":"https://api.github.com/repos/wikimedia/wikipedia-ios/pulls/142","id":46664223,"html_url":"https://github.com/wikimedia/wikipedia-ios/pull/142","diff_url":"https://github.com/wikimedia/wikipedia-ios/pull/142.diff","patch_url":"https://github.com/wikimedia/wikipedia-ios/pull/142.patch","issue_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/issues/142","number":142,"state":"open","locked":false,"title":"ToC update","user":{"login":"coreyfloyd","id":64771,"avatar_url":"https://avatars.githubusercontent.com/u/64771?v=3","gravatar_id":"","url":"https://api.github.com/users/coreyfloyd","html_url":"https://github.com/coreyfloyd","followers_url":"https://api.github.com/users/coreyfloyd/followers","following_url":"https://api.github.com/users/coreyfloyd/following{/other_user}","gists_url":"https://api.github.com/users/coreyfloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/coreyfloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreyfloyd/subscriptions","organizations_url":"https://api.github.com/users/coreyfloyd/orgs","repos_url":"https://api.github.com/users/coreyfloyd/repos","events_url":"https://api.github.com/users/coreyfloyd/events{/privacy}","received_events_url":"https://api.github.com/users/coreyfloyd/received_events","type":"User","site_admin":false},"body":"Added ToC\r\n\r\n- New ToC VC - a table view.\r\n- New cell for the table view\r\n- Used presentation controller / transitioning API for presentation\r\n- Wrote mostly in Swift\r\n- Implemented some section list introspection\r\n- Removed old ToC\r\n\r\nSome style notes:\r\n- The mock has no status bar… but we have a status bar. Animating it offscreen causes other issues for the main article view (tried that). So we need to discus with design if we really want to remove the status bar.\r\n- The \"scroll\" web view to a section logic seems not great. It instantly scrolls - we should probably scroll with animation. Also `currentVisibleSection` seems to return the section above sometimes (seems like it has to do with the navigation bar) Need to get with @montehurd and maybe create a ticket to address.\r\n\r\n\r\n","created_at":"2015-10-02T18:05:29Z","updated_at":"2015-10-06T20:29:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dda3812213456d4c059c1ada316664de4b738a45","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/pulls/142/commits","review_comments_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/pulls/142/comments","review_comment_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/issues/142/comments","statuses_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/statuses/d02a6f9710c7c87b8f2aca82eaf47ff34793eeb2","head":{"label":"wikimedia:feature/T113549/toc","ref":"feature/T113549/toc","sha":"d02a6f9710c7c87b8f2aca82eaf47ff34793eeb2","user":{"login":"wikimedia","id":56668,"avatar_url":"https://avatars.githubusercontent.com/u/56668?v=3","gravatar_id":"","url":"https://api.github.com/users/wikimedia","html_url":"https://github.com/wikimedia","followers_url":"https://api.github.com/users/wikimedia/followers","following_url":"https://api.github.com/users/wikimedia/following{/other_user}","gists_url":"https://api.github.com/users/wikimedia/gists{/gist_id}","starred_url":"https://api.github.com/users/wikimedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wikimedia/subscriptions","organizations_url":"https://api.github.com/users/wikimedia/orgs","repos_url":"https://api.github.com/users/wikimedia/repos","events_url":"https://api.github.com/users/wikimedia/events{/privacy}","received_events_url":"https://api.github.com/users/wikimedia/received_events","type":"Organization","site_admin":false},"repo":{"id":13863130,"name":"wikipedia-ios","full_name":"wikimedia/wikipedia-ios","owner":{"login":"wikimedia","id":56668,"avatar_url":"https://avatars.githubusercontent.com/u/56668?v=3","gravatar_id":"","url":"https://api.github.com/users/wikimedia","html_url":"https://github.com/wikimedia","followers_url":"https://api.github.com/users/wikimedia/followers","following_url":"https://api.github.com/users/wikimedia/following{/other_user}","gists_url":"https://api.github.com/users/wikimedia/gists{/gist_id}","starred_url":"https://api.github.com/users/wikimedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wikimedia/subscriptions","organizations_url":"https://api.github.com/users/wikimedia/orgs","repos_url":"https://api.github.com/users/wikimedia/repos","events_url":"https://api.github.com/users/wikimedia/events{/privacy}","received_events_url":"https://api.github.com/users/wikimedia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wikimedia/wikipedia-ios","description":"The official Wikipedia iOS client.","fork":false,"url":"https://api.github.com/repos/wikimedia/wikipedia-ios","forks_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/forks","keys_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/teams","hooks_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/hooks","issue_events_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/issues/events{/number}","events_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/events","assignees_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/assignees{/user}","branches_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/branches{/branch}","tags_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/tags","blobs_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/languages","stargazers_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/stargazers","contributors_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/contributors","subscribers_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/subscribers","subscription_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/subscription","commits_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/contents/{+path}","compare_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/merges","archive_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/downloads","issues_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/issues{/number}","pulls_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/labels{/name}","releases_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/releases{/id}","created_at":"2013-10-25T14:36:56Z","updated_at":"2015-10-01T11:43:57Z","pushed_at":"2015-10-06T20:29:08Z","git_url":"git://github.com/wikimedia/wikipedia-ios.git","ssh_url":"git@github.com:wikimedia/wikipedia-ios.git","clone_url":"https://github.com/wikimedia/wikipedia-ios.git","svn_url":"https://github.com/wikimedia/wikipedia-ios","homepage":"https://www.mediawiki.org/wiki/Wikimedia_Apps","size":92431,"stargazers_count":399,"watchers_count":399,"language":"Objective-C","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":112,"mirror_url":null,"open_issues_count":3,"forks":112,"open_issues":3,"watchers":399,"default_branch":"master"}},"base":{"label":"wikimedia:master","ref":"master","sha":"8d0c9885916992691244e6b8a8c6688b611e709b","user":{"login":"wikimedia","id":56668,"avatar_url":"https://avatars.githubusercontent.com/u/56668?v=3","gravatar_id":"","url":"https://api.github.com/users/wikimedia","html_url":"https://github.com/wikimedia","followers_url":"https://api.github.com/users/wikimedia/followers","following_url":"https://api.github.com/users/wikimedia/following{/other_user}","gists_url":"https://api.github.com/users/wikimedia/gists{/gist_id}","starred_url":"https://api.github.com/users/wikimedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wikimedia/subscriptions","organizations_url":"https://api.github.com/users/wikimedia/orgs","repos_url":"https://api.github.com/users/wikimedia/repos","events_url":"https://api.github.com/users/wikimedia/events{/privacy}","received_events_url":"https://api.github.com/users/wikimedia/received_events","type":"Organization","site_admin":false},"repo":{"id":13863130,"name":"wikipedia-ios","full_name":"wikimedia/wikipedia-ios","owner":{"login":"wikimedia","id":56668,"avatar_url":"https://avatars.githubusercontent.com/u/56668?v=3","gravatar_id":"","url":"https://api.github.com/users/wikimedia","html_url":"https://github.com/wikimedia","followers_url":"https://api.github.com/users/wikimedia/followers","following_url":"https://api.github.com/users/wikimedia/following{/other_user}","gists_url":"https://api.github.com/users/wikimedia/gists{/gist_id}","starred_url":"https://api.github.com/users/wikimedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wikimedia/subscriptions","organizations_url":"https://api.github.com/users/wikimedia/orgs","repos_url":"https://api.github.com/users/wikimedia/repos","events_url":"https://api.github.com/users/wikimedia/events{/privacy}","received_events_url":"https://api.github.com/users/wikimedia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wikimedia/wikipedia-ios","description":"The official Wikipedia iOS client.","fork":false,"url":"https://api.github.com/repos/wikimedia/wikipedia-ios","forks_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/forks","keys_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/teams","hooks_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/hooks","issue_events_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/issues/events{/number}","events_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/events","assignees_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/assignees{/user}","branches_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/branches{/branch}","tags_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/tags","blobs_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/languages","stargazers_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/stargazers","contributors_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/contributors","subscribers_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/subscribers","subscription_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/subscription","commits_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/contents/{+path}","compare_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/merges","archive_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/downloads","issues_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/issues{/number}","pulls_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/labels{/name}","releases_url":"https://api.github.com/repos/wikimedia/wikipedia-ios/releases{/id}","created_at":"2013-10-25T14:36:56Z","updated_at":"2015-10-01T11:43:57Z","pushed_at":"2015-10-06T20:29:08Z","git_url":"git://github.com/wikimedia/wikipedia-ios.git","ssh_url":"git@github.com:wikimedia/wikipedia-ios.git","clone_url":"https://github.com/wikimedia/wikipedia-ios.git","svn_url":"https://github.com/wikimedia/wikipedia-ios","homepage":"https://www.mediawiki.org/wiki/Wikimedia_Apps","size":92431,"stargazers_count":399,"watchers_count":399,"language":"Objective-C","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":112,"mirror_url":null,"open_issues_count":3,"forks":112,"open_issues":3,"watchers":399,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wikimedia/wikipedia-ios/pulls/142"},"html":{"href":"https://github.com/wikimedia/wikipedia-ios/pull/142"},"issue":{"href":"https://api.github.com/repos/wikimedia/wikipedia-ios/issues/142"},"comments":{"href":"https://api.github.com/repos/wikimedia/wikipedia-ios/issues/142/comments"},"review_comments":{"href":"https://api.github.com/repos/wikimedia/wikipedia-ios/pulls/142/comments"},"review_comment":{"href":"https://api.github.com/repos/wikimedia/wikipedia-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wikimedia/wikipedia-ios/pulls/142/commits"},"statuses":{"href":"https://api.github.com/repos/wikimedia/wikipedia-ios/statuses/d02a6f9710c7c87b8f2aca82eaf47ff34793eeb2"}}}}