{"action":"created","comment":{"url":"https://api.github.com/repos/toshiapp/toshi-ios-client/pulls/comments/166486635","pull_request_review_id":94555994,"id":166486635,"diff_hunk":"@@ -0,0 +1,151 @@\n+// Copyright (c) 2018 Token Browser, Inc\n+//\n+// This program is free software: you can redistribute it and/or modify\n+// it under the terms of the GNU General Public License as published by\n+// the Free Software Foundation, either version 3 of the License, or\n+// (at your option) any later version.\n+//\n+// This program is distributed in the hope that it will be useful,\n+// but WITHOUT ANY WARRANTY; without even the implied warranty of\n+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+// GNU General Public License for more details.\n+//\n+// You should have received a copy of the GNU General Public License\n+// along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+\n+import UIKit\n+\n+final class WalletViewController: UIViewController {\n+\n+    private lazy var tableView: UITableView = {\n+        let view = UITableView(frame: self.view.frame, style: .plain)\n+        view.translatesAutoresizingMaskIntoConstraints = false\n+\n+        view.backgroundColor = nil\n+        BasicTableViewCell.register(in: view)\n+        view.delegate = self\n+        view.dataSource = self\n+        view.tableFooterView = UIView()\n+        view.layer.borderWidth = .lineHeight\n+        view.layer.borderColor = Theme.borderColor.cgColor\n+        view.alwaysBounceVertical = true\n+\n+        return view\n+    }()\n+\n+    private lazy var tableHeaderView: UIView = {\n+        let walletItemTitles = [Localized(\"wallet_tokens\"), Localized(\"wallet_collectibles\")]\n+        let headerView = SegmentedHeaderView(segmentNames: walletItemTitles, delegate: self)\n+        headerView.backgroundColor = Theme.viewBackgroundColor\n+\n+        return headerView\n+    }()\n+\n+    private lazy var datasource = WalletDatasource(delegate: self)\n+\n+    override func viewDidLoad() {\n+        super.viewDidLoad()\n+\n+        datasource.setupFakeItems()\n+\n+        title = Localized(\"wallet_controller_title\")\n+        view.backgroundColor = Theme.lightGrayBackgroundColor\n+\n+        addSubviewsAndConstraints()\n+\n+        preferLargeTitleIfPossible(false)\n+    }\n+\n+    private func addSubviewsAndConstraints() {\n+        view.addSubview(tableView)\n+        tableView.edges(to: view)\n+\n+        let frame = CGRect(origin: .zero, size: CGSize(width: tableView.bounds.width, height: 110))\n+        let headerView = WalletTableHeaderView(frame: frame,\n+                                               address: Cereal.shared.paymentAddress,\n+                                               delegate: self)\n+        tableView.tableHeaderView = headerView\n+    }\n+}\n+\n+extension WalletViewController: UITableViewDataSource {\n+\n+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {\n+        return datasource.numberOfItems\n+    }\n+\n+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {\n+        return tableHeaderView\n+    }\n+\n+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {\n+        return 44\n+    }\n+\n+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {\n+\n+        guard let walletItem = datasource.item(at: indexPath.row) else {\n+            assertionFailure(\"Can't retrieve item at index: \\(indexPath.row)\")\n+            return UITableViewCell()\n+        }\n+\n+        var cellData: TableCellData!\n+\n+        switch datasource.itemsType {\n+        case .token:\n+            cellData = TableCellData(title: walletItem.title, subtitle: walletItem.subtitle, leftImagePath: walletItem.iconPath, topDetails: walletItem.details)\n+        case .collectibles:\n+            cellData = TableCellData(title: walletItem.title, subtitle: walletItem.subtitle, leftImagePath: walletItem.iconPath, details: walletItem.details)\n+        }\n+\n+        let configurator = WalletItemCellConfigurator()\n+        let reuseIdentifier = configurator.cellIdentifier(for: cellData.components)\n+\n+        guard let cell = tableView.dequeueReusableCell(withIdentifier: reuseIdentifier, for: indexPath) as? BasicTableViewCell else {\n+            assertionFailure(\"Can't dequeue basic cell on wallet view controller for given reuse identifier: \\(reuseIdentifier)\")\n+            return UITableViewCell()\n+        }\n+\n+        configurator.configureCell(cell, with: cellData)\n+        cell.accessoryType = .disclosureIndicator\n+\n+        return cell\n+    }\n+}\n+\n+extension WalletViewController: UITableViewDelegate {\n+\n+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {\n+        // show details","path":"Toshi/Controllers/Wallet/WalletViewController.swift","position":122,"original_position":119,"commit_id":"e095649a4e59b15f7546b77cb37ba07840eb9add","original_commit_id":"01f476f89bbe76a36a7ebd3a3f2243dd2c3d6f0e","user":{"login":"designatednerd","id":1976498,"avatar_url":"https://avatars1.githubusercontent.com/u/1976498?v=4","gravatar_id":"","url":"https://api.github.com/users/designatednerd","html_url":"https://github.com/designatednerd","followers_url":"https://api.github.com/users/designatednerd/followers","following_url":"https://api.github.com/users/designatednerd/following{/other_user}","gists_url":"https://api.github.com/users/designatednerd/gists{/gist_id}","starred_url":"https://api.github.com/users/designatednerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/designatednerd/subscriptions","organizations_url":"https://api.github.com/users/designatednerd/orgs","repos_url":"https://api.github.com/users/designatednerd/repos","events_url":"https://api.github.com/users/designatednerd/events{/privacy}","received_events_url":"https://api.github.com/users/designatednerd/received_events","type":"User","site_admin":false},"body":"worth making this show the little quick alert with some placeholder text? ","created_at":"2018-02-07T00:28:18Z","updated_at":"2018-02-07T00:28:18Z","html_url":"https://github.com/toshiapp/toshi-ios-client/pull/723#discussion_r166486635","pull_request_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/pulls/723","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/toshiapp/toshi-ios-client/pulls/comments/166486635"},"html":{"href":"https://github.com/toshiapp/toshi-ios-client/pull/723#discussion_r166486635"},"pull_request":{"href":"https://api.github.com/repos/toshiapp/toshi-ios-client/pulls/723"}},"in_reply_to_id":166484735},"pull_request":{"url":"https://api.github.com/repos/toshiapp/toshi-ios-client/pulls/723","id":167539528,"html_url":"https://github.com/toshiapp/toshi-ios-client/pull/723","diff_url":"https://github.com/toshiapp/toshi-ios-client/pull/723.diff","patch_url":"https://github.com/toshiapp/toshi-ios-client/pull/723.patch","issue_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/issues/723","number":723,"state":"open","locked":false,"title":"[WIP]: Wallet controller","user":{"login":"yuliaveres","id":27722554,"avatar_url":"https://avatars2.githubusercontent.com/u/27722554?v=4","gravatar_id":"","url":"https://api.github.com/users/yuliaveres","html_url":"https://github.com/yuliaveres","followers_url":"https://api.github.com/users/yuliaveres/followers","following_url":"https://api.github.com/users/yuliaveres/following{/other_user}","gists_url":"https://api.github.com/users/yuliaveres/gists{/gist_id}","starred_url":"https://api.github.com/users/yuliaveres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuliaveres/subscriptions","organizations_url":"https://api.github.com/users/yuliaveres/orgs","repos_url":"https://api.github.com/users/yuliaveres/repos","events_url":"https://api.github.com/users/yuliaveres/events{/privacy}","received_events_url":"https://api.github.com/users/yuliaveres/received_events","type":"User","site_admin":false},"body":"Scanner tab is replaced with wallet controller;\r\n2 types of generic cells are added;\r\ntokens and collectibles fetch is added (including tests).\r\n\r\n**The only missing part is empty states here**","created_at":"2018-02-06T21:53:22Z","updated_at":"2018-02-07T00:28:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"228e23c9265aa8ec0a6b9f559382c4368daaf571","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/pulls/723/commits","review_comments_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/pulls/723/comments","review_comment_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/issues/723/comments","statuses_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/statuses/e095649a4e59b15f7546b77cb37ba07840eb9add","head":{"label":"toshiapp:feature/wallet-controller","ref":"feature/wallet-controller","sha":"e095649a4e59b15f7546b77cb37ba07840eb9add","user":{"login":"toshiapp","id":18060234,"avatar_url":"https://avatars3.githubusercontent.com/u/18060234?v=4","gravatar_id":"","url":"https://api.github.com/users/toshiapp","html_url":"https://github.com/toshiapp","followers_url":"https://api.github.com/users/toshiapp/followers","following_url":"https://api.github.com/users/toshiapp/following{/other_user}","gists_url":"https://api.github.com/users/toshiapp/gists{/gist_id}","starred_url":"https://api.github.com/users/toshiapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toshiapp/subscriptions","organizations_url":"https://api.github.com/users/toshiapp/orgs","repos_url":"https://api.github.com/users/toshiapp/repos","events_url":"https://api.github.com/users/toshiapp/events{/privacy}","received_events_url":"https://api.github.com/users/toshiapp/received_events","type":"Organization","site_admin":false},"repo":{"id":78760233,"name":"toshi-ios-client","full_name":"toshiapp/toshi-ios-client","owner":{"login":"toshiapp","id":18060234,"avatar_url":"https://avatars3.githubusercontent.com/u/18060234?v=4","gravatar_id":"","url":"https://api.github.com/users/toshiapp","html_url":"https://github.com/toshiapp","followers_url":"https://api.github.com/users/toshiapp/followers","following_url":"https://api.github.com/users/toshiapp/following{/other_user}","gists_url":"https://api.github.com/users/toshiapp/gists{/gist_id}","starred_url":"https://api.github.com/users/toshiapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toshiapp/subscriptions","organizations_url":"https://api.github.com/users/toshiapp/orgs","repos_url":"https://api.github.com/users/toshiapp/repos","events_url":"https://api.github.com/users/toshiapp/events{/privacy}","received_events_url":"https://api.github.com/users/toshiapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/toshiapp/toshi-ios-client","description":"iOS client for Toshi","fork":false,"url":"https://api.github.com/repos/toshiapp/toshi-ios-client","forks_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/forks","keys_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/teams","hooks_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/hooks","issue_events_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/issues/events{/number}","events_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/events","assignees_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/assignees{/user}","branches_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/branches{/branch}","tags_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/tags","blobs_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/statuses/{sha}","languages_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/languages","stargazers_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/stargazers","contributors_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/contributors","subscribers_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/subscribers","subscription_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/subscription","commits_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/contents/{+path}","compare_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/merges","archive_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/downloads","issues_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/issues{/number}","pulls_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/pulls{/number}","milestones_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/milestones{/number}","notifications_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/labels{/name}","releases_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/releases{/id}","deployments_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/deployments","created_at":"2017-01-12T15:41:29Z","updated_at":"2018-02-01T21:28:09Z","pushed_at":"2018-02-07T00:26:54Z","git_url":"git://github.com/toshiapp/toshi-ios-client.git","ssh_url":"git@github.com:toshiapp/toshi-ios-client.git","clone_url":"https://github.com/toshiapp/toshi-ios-client.git","svn_url":"https://github.com/toshiapp/toshi-ios-client","homepage":"","size":576143,"stargazers_count":82,"watchers_count":82,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"archived":false,"open_issues_count":22,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":25,"open_issues":22,"watchers":82,"default_branch":"master"}},"base":{"label":"toshiapp:master","ref":"master","sha":"03f65e74287f5c20d122ba7da81f86f3d95a8686","user":{"login":"toshiapp","id":18060234,"avatar_url":"https://avatars3.githubusercontent.com/u/18060234?v=4","gravatar_id":"","url":"https://api.github.com/users/toshiapp","html_url":"https://github.com/toshiapp","followers_url":"https://api.github.com/users/toshiapp/followers","following_url":"https://api.github.com/users/toshiapp/following{/other_user}","gists_url":"https://api.github.com/users/toshiapp/gists{/gist_id}","starred_url":"https://api.github.com/users/toshiapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toshiapp/subscriptions","organizations_url":"https://api.github.com/users/toshiapp/orgs","repos_url":"https://api.github.com/users/toshiapp/repos","events_url":"https://api.github.com/users/toshiapp/events{/privacy}","received_events_url":"https://api.github.com/users/toshiapp/received_events","type":"Organization","site_admin":false},"repo":{"id":78760233,"name":"toshi-ios-client","full_name":"toshiapp/toshi-ios-client","owner":{"login":"toshiapp","id":18060234,"avatar_url":"https://avatars3.githubusercontent.com/u/18060234?v=4","gravatar_id":"","url":"https://api.github.com/users/toshiapp","html_url":"https://github.com/toshiapp","followers_url":"https://api.github.com/users/toshiapp/followers","following_url":"https://api.github.com/users/toshiapp/following{/other_user}","gists_url":"https://api.github.com/users/toshiapp/gists{/gist_id}","starred_url":"https://api.github.com/users/toshiapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toshiapp/subscriptions","organizations_url":"https://api.github.com/users/toshiapp/orgs","repos_url":"https://api.github.com/users/toshiapp/repos","events_url":"https://api.github.com/users/toshiapp/events{/privacy}","received_events_url":"https://api.github.com/users/toshiapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/toshiapp/toshi-ios-client","description":"iOS client for Toshi","fork":false,"url":"https://api.github.com/repos/toshiapp/toshi-ios-client","forks_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/forks","keys_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/teams","hooks_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/hooks","issue_events_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/issues/events{/number}","events_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/events","assignees_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/assignees{/user}","branches_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/branches{/branch}","tags_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/tags","blobs_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/statuses/{sha}","languages_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/languages","stargazers_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/stargazers","contributors_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/contributors","subscribers_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/subscribers","subscription_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/subscription","commits_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/contents/{+path}","compare_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/merges","archive_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/downloads","issues_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/issues{/number}","pulls_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/pulls{/number}","milestones_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/milestones{/number}","notifications_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/labels{/name}","releases_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/releases{/id}","deployments_url":"https://api.github.com/repos/toshiapp/toshi-ios-client/deployments","created_at":"2017-01-12T15:41:29Z","updated_at":"2018-02-01T21:28:09Z","pushed_at":"2018-02-07T00:26:54Z","git_url":"git://github.com/toshiapp/toshi-ios-client.git","ssh_url":"git@github.com:toshiapp/toshi-ios-client.git","clone_url":"https://github.com/toshiapp/toshi-ios-client.git","svn_url":"https://github.com/toshiapp/toshi-ios-client","homepage":"","size":576143,"stargazers_count":82,"watchers_count":82,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"archived":false,"open_issues_count":22,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":25,"open_issues":22,"watchers":82,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/toshiapp/toshi-ios-client/pulls/723"},"html":{"href":"https://github.com/toshiapp/toshi-ios-client/pull/723"},"issue":{"href":"https://api.github.com/repos/toshiapp/toshi-ios-client/issues/723"},"comments":{"href":"https://api.github.com/repos/toshiapp/toshi-ios-client/issues/723/comments"},"review_comments":{"href":"https://api.github.com/repos/toshiapp/toshi-ios-client/pulls/723/comments"},"review_comment":{"href":"https://api.github.com/repos/toshiapp/toshi-ios-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/toshiapp/toshi-ios-client/pulls/723/commits"},"statuses":{"href":"https://api.github.com/repos/toshiapp/toshi-ios-client/statuses/e095649a4e59b15f7546b77cb37ba07840eb9add"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"designatednerd"}}