{"action":"created","comment":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments/48131980","id":48131980,"diff_hunk":"@@ -0,0 +1,271 @@\n+import UIKit\n+import WordPressShared\n+\n+class MeViewController: UITableViewController, UIViewControllerRestoration {\n+    static let restorationIdentifier = \"WPMeRestorationID\"\n+    var handler: ImmuTableViewHandler!\n+\n+    static func viewControllerWithRestorationIdentifierPath(identifierComponents: [AnyObject], coder: NSCoder) -> UIViewController? {\n+        return self.init()\n+    }\n+\n+    // MARK: - Table View Controller\n+\n+    override init(style: UITableViewStyle) {\n+        super.init(style: style)\n+        self.restorationIdentifier = self.dynamicType.restorationIdentifier\n+        self.restorationClass = self.dynamicType\n+    }\n+\n+    required convenience init() {\n+        self.init(style: .Grouped)\n+        let notificationCenter = NSNotificationCenter.defaultCenter()\n+        notificationCenter.addObserver(self, selector: \"refreshModelWithNotification:\", name: WPAccountDefaultWordPressComAccountChangedNotification, object: nil)\n+        notificationCenter.addObserver(self, selector: \"refreshModelWithNotification:\", name: HelpshiftUnreadCountUpdatedNotification, object: nil)\n+    }\n+\n+    required init?(coder aDecoder: NSCoder) {\n+        fatalError(\"init(coder:) has not been implemented\")\n+    }\n+\n+    deinit {\n+        NSNotificationCenter.defaultCenter().removeObserver(self)\n+    }\n+\n+    override func viewDidLoad() {\n+        super.viewDidLoad()\n+\n+        self.title = NSLocalizedString(\"Me\", comment: \"Me page title\")\n+\n+        ImmuTable.registerRows([\n+            NavigationItemRow.self,\n+            BadgeNavigationItemRow.self,\n+            ButtonRow.self,\n+            DestructiveButtonRow.self\n+            ], tableView: self.tableView)\n+\n+        handler = ImmuTableViewHandler(takeOver: self)","path":"WordPress/Classes/ViewRelated/MeViewController.swift","position":47,"original_position":47,"commit_id":"efdef6b8d53879ab7e7d677855adefcc215beb84","original_commit_id":"617c8f2e271f411f2e55e919eb0b3c06f625d807","user":{"login":"koke","id":8739,"avatar_url":"https://avatars.githubusercontent.com/u/8739?v=3","gravatar_id":"","url":"https://api.github.com/users/koke","html_url":"https://github.com/koke","followers_url":"https://api.github.com/users/koke/followers","following_url":"https://api.github.com/users/koke/following{/other_user}","gists_url":"https://api.github.com/users/koke/gists{/gist_id}","starred_url":"https://api.github.com/users/koke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koke/subscriptions","organizations_url":"https://api.github.com/users/koke/orgs","repos_url":"https://api.github.com/users/koke/repos","events_url":"https://api.github.com/users/koke/events{/privacy}","received_events_url":"https://api.github.com/users/koke/received_events","type":"User","site_admin":false},"body":"The reason I used `takeOver` is because I wanted to hint that just by initialising it would \"take over\" being the data source and delegate. An alternative I've been considering is to have a `init()` without arguments and then `takeOver(controller)`, but then you'd need two calls each time you want to use it.","created_at":"2015-12-21T10:13:40Z","updated_at":"2015-12-21T10:13:40Z","html_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4589#discussion_r48131980","pull_request_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4589","_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments/48131980"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4589#discussion_r48131980"},"pull_request":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4589"}}},"pull_request":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4589","id":54013929,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4589","diff_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4589.diff","patch_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4589.patch","issue_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/4589","number":4589,"state":"open","locked":false,"title":"Rewrite MeViewController using ImmuTable","user":{"login":"koke","id":8739,"avatar_url":"https://avatars.githubusercontent.com/u/8739?v=3","gravatar_id":"","url":"https://api.github.com/users/koke","html_url":"https://github.com/koke","followers_url":"https://api.github.com/users/koke/followers","following_url":"https://api.github.com/users/koke/following{/other_user}","gists_url":"https://api.github.com/users/koke/gists{/gist_id}","starred_url":"https://api.github.com/users/koke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koke/subscriptions","organizations_url":"https://api.github.com/users/koke/orgs","repos_url":"https://api.github.com/users/koke/repos","events_url":"https://api.github.com/users/koke/events{/privacy}","received_events_url":"https://api.github.com/users/koke/received_events","type":"User","site_admin":false},"body":"I've tried to just port this to Swift/ImmuTable leaving everything else as it was. I've left a couple notes on things I'd improve and there's also #4416 \r\n\r\nSome things to test:\r\n- VC restoration\r\n- Sign in/out works\r\n- Logged out vs logged in shows the right things\r\n- Helpshift message count\r\n\r\nFixes #4585 \r\n\r\nNeeds Review: @jleandroperez ","created_at":"2015-12-17T18:35:30Z","updated_at":"2015-12-21T10:13:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bffb5c4a9c46357c3991b535780cdcb11d3af8b3","assignee":null,"milestone":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones/51","html_url":"https://github.com/wordpress-mobile/WordPress-iOS/milestones/6.0","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones/51/labels","id":1465750,"number":51,"title":"6.0","description":null,"creator":{"login":"jleandroperez","id":1195260,"avatar_url":"https://avatars.githubusercontent.com/u/1195260?v=3","gravatar_id":"","url":"https://api.github.com/users/jleandroperez","html_url":"https://github.com/jleandroperez","followers_url":"https://api.github.com/users/jleandroperez/followers","following_url":"https://api.github.com/users/jleandroperez/following{/other_user}","gists_url":"https://api.github.com/users/jleandroperez/gists{/gist_id}","starred_url":"https://api.github.com/users/jleandroperez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jleandroperez/subscriptions","organizations_url":"https://api.github.com/users/jleandroperez/orgs","repos_url":"https://api.github.com/users/jleandroperez/repos","events_url":"https://api.github.com/users/jleandroperez/events{/privacy}","received_events_url":"https://api.github.com/users/jleandroperez/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":5,"state":"open","created_at":"2015-12-17T21:05:13Z","updated_at":"2015-12-18T21:54:07Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4589/commits","review_comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4589/comments","review_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/4589/comments","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/efdef6b8d53879ab7e7d677855adefcc215beb84","head":{"label":"wordpress-mobile:feature/immutable-me","ref":"feature/immutable-me","sha":"efdef6b8d53879ab7e7d677855adefcc215beb84","user":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":8859285,"name":"WordPress-iOS","full_name":"wordpress-mobile/WordPress-iOS","owner":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS","description":"WordPress for iOS - Official repository","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/releases{/id}","created_at":"2013-03-18T16:59:33Z","updated_at":"2015-12-20T01:53:02Z","pushed_at":"2015-12-21T10:09:27Z","git_url":"git://github.com/wordpress-mobile/WordPress-iOS.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-iOS.git","clone_url":"https://github.com/wordpress-mobile/WordPress-iOS.git","svn_url":"https://github.com/wordpress-mobile/WordPress-iOS","homepage":"http://ios.wordpress.org/","size":283985,"stargazers_count":794,"watchers_count":794,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":384,"mirror_url":null,"open_issues_count":335,"forks":384,"open_issues":335,"watchers":794,"default_branch":"develop"}},"base":{"label":"wordpress-mobile:develop","ref":"develop","sha":"59028fecbe5def12b0d111cc2c3e6ff4c35aba39","user":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":8859285,"name":"WordPress-iOS","full_name":"wordpress-mobile/WordPress-iOS","owner":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS","description":"WordPress for iOS - Official repository","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/releases{/id}","created_at":"2013-03-18T16:59:33Z","updated_at":"2015-12-20T01:53:02Z","pushed_at":"2015-12-21T10:09:27Z","git_url":"git://github.com/wordpress-mobile/WordPress-iOS.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-iOS.git","clone_url":"https://github.com/wordpress-mobile/WordPress-iOS.git","svn_url":"https://github.com/wordpress-mobile/WordPress-iOS","homepage":"http://ios.wordpress.org/","size":283985,"stargazers_count":794,"watchers_count":794,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":384,"mirror_url":null,"open_issues_count":335,"forks":384,"open_issues":335,"watchers":794,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4589"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4589"},"issue":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/4589"},"comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/4589/comments"},"review_comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4589/comments"},"review_comment":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4589/commits"},"statuses":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/efdef6b8d53879ab7e7d677855adefcc215beb84"}}}}