{"action":"created","comment":{"url":"https://api.github.com/repos/calblueprint/sage-mobile/pulls/comments/47168227","id":47168227,"diff_hunk":"@@ -0,0 +1,101 @@\n+//\n+//  ProfileViewController.swift\n+//  SAGE\n+//\n+//  Created by Erica Yin on 11/21/15.\n+//  Copyright © 2015 Cal Blueprint. All rights reserved.\n+//\n+\n+import Foundation\n+\n+class ProfileViewController: UITableViewController {\n+\n+    var user: User?\n+    var profileView = ProfileView()\n+    var activityIndicator: UIActivityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: .Gray)\n+    \n+    init(user: User) {\n+        self.user = user\n+        super.init(nibName: nil, bundle: nil)\n+    }\n+\n+    required init?(coder aDecoder: NSCoder) {\n+        self.user = User()\n+        fatalError(\"init(coder:) has not been implemented\")\n+    }\n+    \n+    func setupHeader() {\n+        self.tableView = UITableView(frame: self.tableView.frame, style: .Grouped)\n+        self.tableView.tableHeaderView = self.profileView\n+        let headerOffset = self.profileView.viewHeight + CGFloat(40)\n+        var headerFrame = self.tableView.tableHeaderView!.frame\n+        headerFrame.size.height = headerOffset\n+        self.profileView.frame = headerFrame\n+        self.tableView.tableHeaderView = self.profileView\n+    }\n+    \n+    override func viewDidLoad() {\n+        super.viewDidLoad()\n+        self.setupHeader()\n+        self.tableView.tableFooterView = UIView()\n+        \n+        self.view.addSubview(self.activityIndicator)\n+        self.activityIndicator.centerHorizontally()\n+        self.activityIndicator.centerVertically()\n+        self.activityIndicator.startAnimating()\n+        \n+        self.getUser()\n+    }\n+    \n+    func getUser() {\n+        ProfileOperations.getUser(self.user!, completion: { (user) -> Void in\n+            self.profileView.setupWithUser(user)\n+            self.activityIndicator.stopAnimating()\n+            self.tableView.reloadData()\n+            }) { (errorMessage) -> Void in\n+                // display error","path":"sage-ios/SAGE/SAGE/ProfileViewController.swift","position":56,"original_position":56,"commit_id":"f5b539264252b50f34c3762feaafc4593d02f5bd","original_commit_id":"a44bea87a5ed0fab765ba373762214459f9611b5","user":{"login":"amillman","id":4883505,"avatar_url":"https://avatars.githubusercontent.com/u/4883505?v=3","gravatar_id":"","url":"https://api.github.com/users/amillman","html_url":"https://github.com/amillman","followers_url":"https://api.github.com/users/amillman/followers","following_url":"https://api.github.com/users/amillman/following{/other_user}","gists_url":"https://api.github.com/users/amillman/gists{/gist_id}","starred_url":"https://api.github.com/users/amillman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amillman/subscriptions","organizations_url":"https://api.github.com/users/amillman/orgs","repos_url":"https://api.github.com/users/amillman/repos","events_url":"https://api.github.com/users/amillman/events{/privacy}","received_events_url":"https://api.github.com/users/amillman/received_events","type":"User","site_admin":false},"body":"make sure to display an error. check other view controllers for reference","created_at":"2015-12-09T23:17:17Z","updated_at":"2015-12-09T23:17:17Z","html_url":"https://github.com/calblueprint/sage-mobile/pull/72#discussion_r47168227","pull_request_url":"https://api.github.com/repos/calblueprint/sage-mobile/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/calblueprint/sage-mobile/pulls/comments/47168227"},"html":{"href":"https://github.com/calblueprint/sage-mobile/pull/72#discussion_r47168227"},"pull_request":{"href":"https://api.github.com/repos/calblueprint/sage-mobile/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/calblueprint/sage-mobile/pulls/72","id":53050620,"html_url":"https://github.com/calblueprint/sage-mobile/pull/72","diff_url":"https://github.com/calblueprint/sage-mobile/pull/72.diff","patch_url":"https://github.com/calblueprint/sage-mobile/pull/72.patch","issue_url":"https://api.github.com/repos/calblueprint/sage-mobile/issues/72","number":72,"state":"open","locked":false,"title":"Erica/profile","user":{"login":"ericayin","id":6658353,"avatar_url":"https://avatars.githubusercontent.com/u/6658353?v=3","gravatar_id":"","url":"https://api.github.com/users/ericayin","html_url":"https://github.com/ericayin","followers_url":"https://api.github.com/users/ericayin/followers","following_url":"https://api.github.com/users/ericayin/following{/other_user}","gists_url":"https://api.github.com/users/ericayin/gists{/gist_id}","starred_url":"https://api.github.com/users/ericayin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericayin/subscriptions","organizations_url":"https://api.github.com/users/ericayin/orgs","repos_url":"https://api.github.com/users/ericayin/repos","events_url":"https://api.github.com/users/ericayin/events{/privacy}","received_events_url":"https://api.github.com/users/ericayin/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-08T22:44:31Z","updated_at":"2015-12-09T23:17:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e70a9f3103505a6c200d2927fa80eea9d35ee1c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/calblueprint/sage-mobile/pulls/72/commits","review_comments_url":"https://api.github.com/repos/calblueprint/sage-mobile/pulls/72/comments","review_comment_url":"https://api.github.com/repos/calblueprint/sage-mobile/pulls/comments{/number}","comments_url":"https://api.github.com/repos/calblueprint/sage-mobile/issues/72/comments","statuses_url":"https://api.github.com/repos/calblueprint/sage-mobile/statuses/f5b539264252b50f34c3762feaafc4593d02f5bd","head":{"label":"calblueprint:erica/profile","ref":"erica/profile","sha":"f5b539264252b50f34c3762feaafc4593d02f5bd","user":{"login":"calblueprint","id":2729578,"avatar_url":"https://avatars.githubusercontent.com/u/2729578?v=3","gravatar_id":"","url":"https://api.github.com/users/calblueprint","html_url":"https://github.com/calblueprint","followers_url":"https://api.github.com/users/calblueprint/followers","following_url":"https://api.github.com/users/calblueprint/following{/other_user}","gists_url":"https://api.github.com/users/calblueprint/gists{/gist_id}","starred_url":"https://api.github.com/users/calblueprint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calblueprint/subscriptions","organizations_url":"https://api.github.com/users/calblueprint/orgs","repos_url":"https://api.github.com/users/calblueprint/repos","events_url":"https://api.github.com/users/calblueprint/events{/privacy}","received_events_url":"https://api.github.com/users/calblueprint/received_events","type":"Organization","site_admin":false},"repo":{"id":42952348,"name":"sage-mobile","full_name":"calblueprint/sage-mobile","owner":{"login":"calblueprint","id":2729578,"avatar_url":"https://avatars.githubusercontent.com/u/2729578?v=3","gravatar_id":"","url":"https://api.github.com/users/calblueprint","html_url":"https://github.com/calblueprint","followers_url":"https://api.github.com/users/calblueprint/followers","following_url":"https://api.github.com/users/calblueprint/following{/other_user}","gists_url":"https://api.github.com/users/calblueprint/gists{/gist_id}","starred_url":"https://api.github.com/users/calblueprint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calblueprint/subscriptions","organizations_url":"https://api.github.com/users/calblueprint/orgs","repos_url":"https://api.github.com/users/calblueprint/repos","events_url":"https://api.github.com/users/calblueprint/events{/privacy}","received_events_url":"https://api.github.com/users/calblueprint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/calblueprint/sage-mobile","description":"Mobile repo for SAGE","fork":false,"url":"https://api.github.com/repos/calblueprint/sage-mobile","forks_url":"https://api.github.com/repos/calblueprint/sage-mobile/forks","keys_url":"https://api.github.com/repos/calblueprint/sage-mobile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calblueprint/sage-mobile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calblueprint/sage-mobile/teams","hooks_url":"https://api.github.com/repos/calblueprint/sage-mobile/hooks","issue_events_url":"https://api.github.com/repos/calblueprint/sage-mobile/issues/events{/number}","events_url":"https://api.github.com/repos/calblueprint/sage-mobile/events","assignees_url":"https://api.github.com/repos/calblueprint/sage-mobile/assignees{/user}","branches_url":"https://api.github.com/repos/calblueprint/sage-mobile/branches{/branch}","tags_url":"https://api.github.com/repos/calblueprint/sage-mobile/tags","blobs_url":"https://api.github.com/repos/calblueprint/sage-mobile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calblueprint/sage-mobile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calblueprint/sage-mobile/git/refs{/sha}","trees_url":"https://api.github.com/repos/calblueprint/sage-mobile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calblueprint/sage-mobile/statuses/{sha}","languages_url":"https://api.github.com/repos/calblueprint/sage-mobile/languages","stargazers_url":"https://api.github.com/repos/calblueprint/sage-mobile/stargazers","contributors_url":"https://api.github.com/repos/calblueprint/sage-mobile/contributors","subscribers_url":"https://api.github.com/repos/calblueprint/sage-mobile/subscribers","subscription_url":"https://api.github.com/repos/calblueprint/sage-mobile/subscription","commits_url":"https://api.github.com/repos/calblueprint/sage-mobile/commits{/sha}","git_commits_url":"https://api.github.com/repos/calblueprint/sage-mobile/git/commits{/sha}","comments_url":"https://api.github.com/repos/calblueprint/sage-mobile/comments{/number}","issue_comment_url":"https://api.github.com/repos/calblueprint/sage-mobile/issues/comments{/number}","contents_url":"https://api.github.com/repos/calblueprint/sage-mobile/contents/{+path}","compare_url":"https://api.github.com/repos/calblueprint/sage-mobile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calblueprint/sage-mobile/merges","archive_url":"https://api.github.com/repos/calblueprint/sage-mobile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calblueprint/sage-mobile/downloads","issues_url":"https://api.github.com/repos/calblueprint/sage-mobile/issues{/number}","pulls_url":"https://api.github.com/repos/calblueprint/sage-mobile/pulls{/number}","milestones_url":"https://api.github.com/repos/calblueprint/sage-mobile/milestones{/number}","notifications_url":"https://api.github.com/repos/calblueprint/sage-mobile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calblueprint/sage-mobile/labels{/name}","releases_url":"https://api.github.com/repos/calblueprint/sage-mobile/releases{/id}","created_at":"2015-09-22T18:19:43Z","updated_at":"2015-11-23T05:42:57Z","pushed_at":"2015-12-09T21:41:42Z","git_url":"git://github.com/calblueprint/sage-mobile.git","ssh_url":"git@github.com:calblueprint/sage-mobile.git","clone_url":"https://github.com/calblueprint/sage-mobile.git","svn_url":"https://github.com/calblueprint/sage-mobile","homepage":null,"size":11226,"stargazers_count":1,"watchers_count":1,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":1,"default_branch":"master"}},"base":{"label":"calblueprint:master","ref":"master","sha":"68332772bdce3477fc15469375d2a4b87e45765b","user":{"login":"calblueprint","id":2729578,"avatar_url":"https://avatars.githubusercontent.com/u/2729578?v=3","gravatar_id":"","url":"https://api.github.com/users/calblueprint","html_url":"https://github.com/calblueprint","followers_url":"https://api.github.com/users/calblueprint/followers","following_url":"https://api.github.com/users/calblueprint/following{/other_user}","gists_url":"https://api.github.com/users/calblueprint/gists{/gist_id}","starred_url":"https://api.github.com/users/calblueprint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calblueprint/subscriptions","organizations_url":"https://api.github.com/users/calblueprint/orgs","repos_url":"https://api.github.com/users/calblueprint/repos","events_url":"https://api.github.com/users/calblueprint/events{/privacy}","received_events_url":"https://api.github.com/users/calblueprint/received_events","type":"Organization","site_admin":false},"repo":{"id":42952348,"name":"sage-mobile","full_name":"calblueprint/sage-mobile","owner":{"login":"calblueprint","id":2729578,"avatar_url":"https://avatars.githubusercontent.com/u/2729578?v=3","gravatar_id":"","url":"https://api.github.com/users/calblueprint","html_url":"https://github.com/calblueprint","followers_url":"https://api.github.com/users/calblueprint/followers","following_url":"https://api.github.com/users/calblueprint/following{/other_user}","gists_url":"https://api.github.com/users/calblueprint/gists{/gist_id}","starred_url":"https://api.github.com/users/calblueprint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calblueprint/subscriptions","organizations_url":"https://api.github.com/users/calblueprint/orgs","repos_url":"https://api.github.com/users/calblueprint/repos","events_url":"https://api.github.com/users/calblueprint/events{/privacy}","received_events_url":"https://api.github.com/users/calblueprint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/calblueprint/sage-mobile","description":"Mobile repo for SAGE","fork":false,"url":"https://api.github.com/repos/calblueprint/sage-mobile","forks_url":"https://api.github.com/repos/calblueprint/sage-mobile/forks","keys_url":"https://api.github.com/repos/calblueprint/sage-mobile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calblueprint/sage-mobile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calblueprint/sage-mobile/teams","hooks_url":"https://api.github.com/repos/calblueprint/sage-mobile/hooks","issue_events_url":"https://api.github.com/repos/calblueprint/sage-mobile/issues/events{/number}","events_url":"https://api.github.com/repos/calblueprint/sage-mobile/events","assignees_url":"https://api.github.com/repos/calblueprint/sage-mobile/assignees{/user}","branches_url":"https://api.github.com/repos/calblueprint/sage-mobile/branches{/branch}","tags_url":"https://api.github.com/repos/calblueprint/sage-mobile/tags","blobs_url":"https://api.github.com/repos/calblueprint/sage-mobile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calblueprint/sage-mobile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calblueprint/sage-mobile/git/refs{/sha}","trees_url":"https://api.github.com/repos/calblueprint/sage-mobile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calblueprint/sage-mobile/statuses/{sha}","languages_url":"https://api.github.com/repos/calblueprint/sage-mobile/languages","stargazers_url":"https://api.github.com/repos/calblueprint/sage-mobile/stargazers","contributors_url":"https://api.github.com/repos/calblueprint/sage-mobile/contributors","subscribers_url":"https://api.github.com/repos/calblueprint/sage-mobile/subscribers","subscription_url":"https://api.github.com/repos/calblueprint/sage-mobile/subscription","commits_url":"https://api.github.com/repos/calblueprint/sage-mobile/commits{/sha}","git_commits_url":"https://api.github.com/repos/calblueprint/sage-mobile/git/commits{/sha}","comments_url":"https://api.github.com/repos/calblueprint/sage-mobile/comments{/number}","issue_comment_url":"https://api.github.com/repos/calblueprint/sage-mobile/issues/comments{/number}","contents_url":"https://api.github.com/repos/calblueprint/sage-mobile/contents/{+path}","compare_url":"https://api.github.com/repos/calblueprint/sage-mobile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calblueprint/sage-mobile/merges","archive_url":"https://api.github.com/repos/calblueprint/sage-mobile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calblueprint/sage-mobile/downloads","issues_url":"https://api.github.com/repos/calblueprint/sage-mobile/issues{/number}","pulls_url":"https://api.github.com/repos/calblueprint/sage-mobile/pulls{/number}","milestones_url":"https://api.github.com/repos/calblueprint/sage-mobile/milestones{/number}","notifications_url":"https://api.github.com/repos/calblueprint/sage-mobile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calblueprint/sage-mobile/labels{/name}","releases_url":"https://api.github.com/repos/calblueprint/sage-mobile/releases{/id}","created_at":"2015-09-22T18:19:43Z","updated_at":"2015-11-23T05:42:57Z","pushed_at":"2015-12-09T21:41:42Z","git_url":"git://github.com/calblueprint/sage-mobile.git","ssh_url":"git@github.com:calblueprint/sage-mobile.git","clone_url":"https://github.com/calblueprint/sage-mobile.git","svn_url":"https://github.com/calblueprint/sage-mobile","homepage":null,"size":11226,"stargazers_count":1,"watchers_count":1,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/calblueprint/sage-mobile/pulls/72"},"html":{"href":"https://github.com/calblueprint/sage-mobile/pull/72"},"issue":{"href":"https://api.github.com/repos/calblueprint/sage-mobile/issues/72"},"comments":{"href":"https://api.github.com/repos/calblueprint/sage-mobile/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/calblueprint/sage-mobile/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/calblueprint/sage-mobile/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/calblueprint/sage-mobile/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/calblueprint/sage-mobile/statuses/f5b539264252b50f34c3762feaafc4593d02f5bd"}}}}