{"action":"created","comment":{"url":"https://api.github.com/repos/DanaDrimba/LastFM/pulls/comments/81957236","pull_request_review_id":2895772,"id":81957236,"diff_hunk":"@@ -0,0 +1,100 @@\n+//\n+//  ArtistAlbumsCollectionViewController.swift\n+//  LastFM\n+//\n+//  Created by Dana Drimba on 04/10/16.\n+//  Copyright © 2016 Dana Drimba. All rights reserved.\n+//\n+\n+import UIKit\n+import SwiftyJSON\n+\n+class ArtistAlbumsCollectionViewController: UICollectionViewController {\n+    \n+    let reuseIdentifier = \"AlbumCell\"\n+    \n+    let itemsPerRow: CGFloat = 3\n+    \n+    let sectionInsets = UIEdgeInsets(top: 50.0, left: 20.0, bottom: 50.0, right: 20.0)\n+    \n+    var items = [LastFMArtistAlbum]()\n+\n+    override func viewDidLoad() {\n+        super.viewDidLoad()\n+        //get the parameter from the previous view controller\n+        self.getTopAlbums(forArtist: \"Coldplay\")\n+    }\n+    \n+    func getTopAlbums(forArtist: String) {\n+        \n+        DataManager.sharedInstance.getTopAlbums(forArtist: forArtist) { (json:JSON) in\n+            if let results = json[\"topalbums\"][\"album\"].array {\n+                for entry in results {\n+                    self.items.append(LastFMArtistAlbum(json: entry))\n+                }\n+                DispatchQueue.main.async(execute: {\n+                    self.collectionView?.reloadData()\n+                })\n+        }\n+        \n+        }\n+    }\n+\n+    override func didReceiveMemoryWarning() {\n+        super.didReceiveMemoryWarning()\n+        // Dispose of any resources that can be recreated.\n+    }\n+\n+    // MARK: UICollectionViewDataSource\n+\n+    override func numberOfSections(in collectionView: UICollectionView) -> Int {\n+        return 1\n+    }\n+\n+\n+    override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {\n+        return self.items.count\n+    }\n+\n+    override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {\n+        \n+        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) as! AlbumCoverCollectionViewCell\n+    \n+        let album = self.items[indexPath.row]","path":"LastFM/ArtistAlbumsCollectionViewController.swift","position":63,"original_position":63,"commit_id":"9115d7e4fa65a3523d5ae1830564eb07f17b4736","original_commit_id":"9115d7e4fa65a3523d5ae1830564eb07f17b4736","user":{"login":"flaviu88","id":13012430,"avatar_url":"https://avatars.githubusercontent.com/u/13012430?v=3","gravatar_id":"","url":"https://api.github.com/users/flaviu88","html_url":"https://github.com/flaviu88","followers_url":"https://api.github.com/users/flaviu88/followers","following_url":"https://api.github.com/users/flaviu88/following{/other_user}","gists_url":"https://api.github.com/users/flaviu88/gists{/gist_id}","starred_url":"https://api.github.com/users/flaviu88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flaviu88/subscriptions","organizations_url":"https://api.github.com/users/flaviu88/orgs","repos_url":"https://api.github.com/users/flaviu88/repos","events_url":"https://api.github.com/users/flaviu88/events{/privacy}","received_events_url":"https://api.github.com/users/flaviu88/received_events","type":"User","site_admin":false},"body":"You aren't required to explicitly  use self before accessing a variable from the same class. You can just use: items[indexPath.row] . The only place where you need to explicitly add self before a variable is in a closure. ","created_at":"2016-10-05T12:04:44Z","updated_at":"2016-10-05T12:04:44Z","html_url":"https://github.com/DanaDrimba/LastFM/pull/1#discussion_r81957236","pull_request_url":"https://api.github.com/repos/DanaDrimba/LastFM/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/DanaDrimba/LastFM/pulls/comments/81957236"},"html":{"href":"https://github.com/DanaDrimba/LastFM/pull/1#discussion_r81957236"},"pull_request":{"href":"https://api.github.com/repos/DanaDrimba/LastFM/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/DanaDrimba/LastFM/pulls/1","id":88061079,"html_url":"https://github.com/DanaDrimba/LastFM/pull/1","diff_url":"https://github.com/DanaDrimba/LastFM/pull/1.diff","patch_url":"https://github.com/DanaDrimba/LastFM/pull/1.patch","issue_url":"https://api.github.com/repos/DanaDrimba/LastFM/issues/1","number":1,"state":"open","locked":false,"title":"Updated not working swiftyjson and add collection view to display albums when clicking on artist","user":{"login":"DanaDrimba","id":4905387,"avatar_url":"https://avatars.githubusercontent.com/u/4905387?v=3","gravatar_id":"","url":"https://api.github.com/users/DanaDrimba","html_url":"https://github.com/DanaDrimba","followers_url":"https://api.github.com/users/DanaDrimba/followers","following_url":"https://api.github.com/users/DanaDrimba/following{/other_user}","gists_url":"https://api.github.com/users/DanaDrimba/gists{/gist_id}","starred_url":"https://api.github.com/users/DanaDrimba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanaDrimba/subscriptions","organizations_url":"https://api.github.com/users/DanaDrimba/orgs","repos_url":"https://api.github.com/users/DanaDrimba/repos","events_url":"https://api.github.com/users/DanaDrimba/events{/privacy}","received_events_url":"https://api.github.com/users/DanaDrimba/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-05T11:36:19Z","updated_at":"2016-10-05T12:10:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7d2f12e206d061abeb54e135cdf6a49be762d76","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/DanaDrimba/LastFM/pulls/1/commits","review_comments_url":"https://api.github.com/repos/DanaDrimba/LastFM/pulls/1/comments","review_comment_url":"https://api.github.com/repos/DanaDrimba/LastFM/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DanaDrimba/LastFM/issues/1/comments","statuses_url":"https://api.github.com/repos/DanaDrimba/LastFM/statuses/9115d7e4fa65a3523d5ae1830564eb07f17b4736","head":{"label":"DanaDrimba:UpdatedNotWorkingSwiftyJSON","ref":"UpdatedNotWorkingSwiftyJSON","sha":"9115d7e4fa65a3523d5ae1830564eb07f17b4736","user":{"login":"DanaDrimba","id":4905387,"avatar_url":"https://avatars.githubusercontent.com/u/4905387?v=3","gravatar_id":"","url":"https://api.github.com/users/DanaDrimba","html_url":"https://github.com/DanaDrimba","followers_url":"https://api.github.com/users/DanaDrimba/followers","following_url":"https://api.github.com/users/DanaDrimba/following{/other_user}","gists_url":"https://api.github.com/users/DanaDrimba/gists{/gist_id}","starred_url":"https://api.github.com/users/DanaDrimba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanaDrimba/subscriptions","organizations_url":"https://api.github.com/users/DanaDrimba/orgs","repos_url":"https://api.github.com/users/DanaDrimba/repos","events_url":"https://api.github.com/users/DanaDrimba/events{/privacy}","received_events_url":"https://api.github.com/users/DanaDrimba/received_events","type":"User","site_admin":false},"repo":{"id":68720671,"name":"LastFM","full_name":"DanaDrimba/LastFM","owner":{"login":"DanaDrimba","id":4905387,"avatar_url":"https://avatars.githubusercontent.com/u/4905387?v=3","gravatar_id":"","url":"https://api.github.com/users/DanaDrimba","html_url":"https://github.com/DanaDrimba","followers_url":"https://api.github.com/users/DanaDrimba/followers","following_url":"https://api.github.com/users/DanaDrimba/following{/other_user}","gists_url":"https://api.github.com/users/DanaDrimba/gists{/gist_id}","starred_url":"https://api.github.com/users/DanaDrimba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanaDrimba/subscriptions","organizations_url":"https://api.github.com/users/DanaDrimba/orgs","repos_url":"https://api.github.com/users/DanaDrimba/repos","events_url":"https://api.github.com/users/DanaDrimba/events{/privacy}","received_events_url":"https://api.github.com/users/DanaDrimba/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DanaDrimba/LastFM","description":null,"fork":false,"url":"https://api.github.com/repos/DanaDrimba/LastFM","forks_url":"https://api.github.com/repos/DanaDrimba/LastFM/forks","keys_url":"https://api.github.com/repos/DanaDrimba/LastFM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DanaDrimba/LastFM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DanaDrimba/LastFM/teams","hooks_url":"https://api.github.com/repos/DanaDrimba/LastFM/hooks","issue_events_url":"https://api.github.com/repos/DanaDrimba/LastFM/issues/events{/number}","events_url":"https://api.github.com/repos/DanaDrimba/LastFM/events","assignees_url":"https://api.github.com/repos/DanaDrimba/LastFM/assignees{/user}","branches_url":"https://api.github.com/repos/DanaDrimba/LastFM/branches{/branch}","tags_url":"https://api.github.com/repos/DanaDrimba/LastFM/tags","blobs_url":"https://api.github.com/repos/DanaDrimba/LastFM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DanaDrimba/LastFM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DanaDrimba/LastFM/git/refs{/sha}","trees_url":"https://api.github.com/repos/DanaDrimba/LastFM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DanaDrimba/LastFM/statuses/{sha}","languages_url":"https://api.github.com/repos/DanaDrimba/LastFM/languages","stargazers_url":"https://api.github.com/repos/DanaDrimba/LastFM/stargazers","contributors_url":"https://api.github.com/repos/DanaDrimba/LastFM/contributors","subscribers_url":"https://api.github.com/repos/DanaDrimba/LastFM/subscribers","subscription_url":"https://api.github.com/repos/DanaDrimba/LastFM/subscription","commits_url":"https://api.github.com/repos/DanaDrimba/LastFM/commits{/sha}","git_commits_url":"https://api.github.com/repos/DanaDrimba/LastFM/git/commits{/sha}","comments_url":"https://api.github.com/repos/DanaDrimba/LastFM/comments{/number}","issue_comment_url":"https://api.github.com/repos/DanaDrimba/LastFM/issues/comments{/number}","contents_url":"https://api.github.com/repos/DanaDrimba/LastFM/contents/{+path}","compare_url":"https://api.github.com/repos/DanaDrimba/LastFM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DanaDrimba/LastFM/merges","archive_url":"https://api.github.com/repos/DanaDrimba/LastFM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DanaDrimba/LastFM/downloads","issues_url":"https://api.github.com/repos/DanaDrimba/LastFM/issues{/number}","pulls_url":"https://api.github.com/repos/DanaDrimba/LastFM/pulls{/number}","milestones_url":"https://api.github.com/repos/DanaDrimba/LastFM/milestones{/number}","notifications_url":"https://api.github.com/repos/DanaDrimba/LastFM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DanaDrimba/LastFM/labels{/name}","releases_url":"https://api.github.com/repos/DanaDrimba/LastFM/releases{/id}","deployments_url":"https://api.github.com/repos/DanaDrimba/LastFM/deployments","created_at":"2016-09-20T14:33:28Z","updated_at":"2016-09-20T14:35:48Z","pushed_at":"2016-10-05T12:08:28Z","git_url":"git://github.com/DanaDrimba/LastFM.git","ssh_url":"git@github.com:DanaDrimba/LastFM.git","clone_url":"https://github.com/DanaDrimba/LastFM.git","svn_url":"https://github.com/DanaDrimba/LastFM","homepage":null,"size":62,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"DanaDrimba:master","ref":"master","sha":"3885d2b675dccdb435280a871225e0173eccc343","user":{"login":"DanaDrimba","id":4905387,"avatar_url":"https://avatars.githubusercontent.com/u/4905387?v=3","gravatar_id":"","url":"https://api.github.com/users/DanaDrimba","html_url":"https://github.com/DanaDrimba","followers_url":"https://api.github.com/users/DanaDrimba/followers","following_url":"https://api.github.com/users/DanaDrimba/following{/other_user}","gists_url":"https://api.github.com/users/DanaDrimba/gists{/gist_id}","starred_url":"https://api.github.com/users/DanaDrimba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanaDrimba/subscriptions","organizations_url":"https://api.github.com/users/DanaDrimba/orgs","repos_url":"https://api.github.com/users/DanaDrimba/repos","events_url":"https://api.github.com/users/DanaDrimba/events{/privacy}","received_events_url":"https://api.github.com/users/DanaDrimba/received_events","type":"User","site_admin":false},"repo":{"id":68720671,"name":"LastFM","full_name":"DanaDrimba/LastFM","owner":{"login":"DanaDrimba","id":4905387,"avatar_url":"https://avatars.githubusercontent.com/u/4905387?v=3","gravatar_id":"","url":"https://api.github.com/users/DanaDrimba","html_url":"https://github.com/DanaDrimba","followers_url":"https://api.github.com/users/DanaDrimba/followers","following_url":"https://api.github.com/users/DanaDrimba/following{/other_user}","gists_url":"https://api.github.com/users/DanaDrimba/gists{/gist_id}","starred_url":"https://api.github.com/users/DanaDrimba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanaDrimba/subscriptions","organizations_url":"https://api.github.com/users/DanaDrimba/orgs","repos_url":"https://api.github.com/users/DanaDrimba/repos","events_url":"https://api.github.com/users/DanaDrimba/events{/privacy}","received_events_url":"https://api.github.com/users/DanaDrimba/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DanaDrimba/LastFM","description":null,"fork":false,"url":"https://api.github.com/repos/DanaDrimba/LastFM","forks_url":"https://api.github.com/repos/DanaDrimba/LastFM/forks","keys_url":"https://api.github.com/repos/DanaDrimba/LastFM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DanaDrimba/LastFM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DanaDrimba/LastFM/teams","hooks_url":"https://api.github.com/repos/DanaDrimba/LastFM/hooks","issue_events_url":"https://api.github.com/repos/DanaDrimba/LastFM/issues/events{/number}","events_url":"https://api.github.com/repos/DanaDrimba/LastFM/events","assignees_url":"https://api.github.com/repos/DanaDrimba/LastFM/assignees{/user}","branches_url":"https://api.github.com/repos/DanaDrimba/LastFM/branches{/branch}","tags_url":"https://api.github.com/repos/DanaDrimba/LastFM/tags","blobs_url":"https://api.github.com/repos/DanaDrimba/LastFM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DanaDrimba/LastFM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DanaDrimba/LastFM/git/refs{/sha}","trees_url":"https://api.github.com/repos/DanaDrimba/LastFM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DanaDrimba/LastFM/statuses/{sha}","languages_url":"https://api.github.com/repos/DanaDrimba/LastFM/languages","stargazers_url":"https://api.github.com/repos/DanaDrimba/LastFM/stargazers","contributors_url":"https://api.github.com/repos/DanaDrimba/LastFM/contributors","subscribers_url":"https://api.github.com/repos/DanaDrimba/LastFM/subscribers","subscription_url":"https://api.github.com/repos/DanaDrimba/LastFM/subscription","commits_url":"https://api.github.com/repos/DanaDrimba/LastFM/commits{/sha}","git_commits_url":"https://api.github.com/repos/DanaDrimba/LastFM/git/commits{/sha}","comments_url":"https://api.github.com/repos/DanaDrimba/LastFM/comments{/number}","issue_comment_url":"https://api.github.com/repos/DanaDrimba/LastFM/issues/comments{/number}","contents_url":"https://api.github.com/repos/DanaDrimba/LastFM/contents/{+path}","compare_url":"https://api.github.com/repos/DanaDrimba/LastFM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DanaDrimba/LastFM/merges","archive_url":"https://api.github.com/repos/DanaDrimba/LastFM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DanaDrimba/LastFM/downloads","issues_url":"https://api.github.com/repos/DanaDrimba/LastFM/issues{/number}","pulls_url":"https://api.github.com/repos/DanaDrimba/LastFM/pulls{/number}","milestones_url":"https://api.github.com/repos/DanaDrimba/LastFM/milestones{/number}","notifications_url":"https://api.github.com/repos/DanaDrimba/LastFM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DanaDrimba/LastFM/labels{/name}","releases_url":"https://api.github.com/repos/DanaDrimba/LastFM/releases{/id}","deployments_url":"https://api.github.com/repos/DanaDrimba/LastFM/deployments","created_at":"2016-09-20T14:33:28Z","updated_at":"2016-09-20T14:35:48Z","pushed_at":"2016-10-05T12:08:28Z","git_url":"git://github.com/DanaDrimba/LastFM.git","ssh_url":"git@github.com:DanaDrimba/LastFM.git","clone_url":"https://github.com/DanaDrimba/LastFM.git","svn_url":"https://github.com/DanaDrimba/LastFM","homepage":null,"size":62,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DanaDrimba/LastFM/pulls/1"},"html":{"href":"https://github.com/DanaDrimba/LastFM/pull/1"},"issue":{"href":"https://api.github.com/repos/DanaDrimba/LastFM/issues/1"},"comments":{"href":"https://api.github.com/repos/DanaDrimba/LastFM/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/DanaDrimba/LastFM/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/DanaDrimba/LastFM/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DanaDrimba/LastFM/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/DanaDrimba/LastFM/statuses/9115d7e4fa65a3523d5ae1830564eb07f17b4736"}}}}
{"actor":{"display_login":"flaviu88"}}