{"action":"created","comment":{"url":"https://api.github.com/repos/cuappdev/acai-ios/pulls/comments/269779228","pull_request_review_id":219730473,"id":269779228,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2OTc3OTIyOA==","diff_hunk":"@@ -0,0 +1,229 @@\n+//\n+//  OrderDetailViewController.swift\n+//  acai-ios\n+//\n+//  Created by Artesia Ko on 3/17/19.\n+//  Copyright © 2019 Cornell AppDev. All rights reserved.\n+//\n+\n+import UIKit\n+import IGListKit\n+import SnapKit\n+\n+protocol DidSelectOptionDelegate: class {\n+    func deselectOption(at index: Int, for type: OrderOption.OptionType)\n+    func selectOption(at index: Int, for type: OrderOption.OptionType)\n+}\n+\n+/// Presents detail and customization options for a menu item.\n+/// Requires menuItem variable to be set\n+class OrderDetailViewController: UIViewController {\n+    \n+    // MARK: View vars\n+    private var addToCartActionTabView: ActionTabView!\n+    private var backgroundGradient: CAGradientLayer!\n+    private var bottomFillerRect: UIView!\n+    private var collectionView: UICollectionView!\n+    private var listAdapter: ListAdapter!\n+\n+    // MARK: Gesture recognizers\n+    private var addToCartTapGestureRecognizer: UITapGestureRecognizer!\n+    \n+    // MARK: Data\n+    var menuItem: MenuItem!\n+    private var optionSectionsMap: [OrderOption.OptionType: [OrderOption]] = [:]\n+    var quantity: NSNumber = 1\n+    \n+    // MARK: Constraint Constants\n+    private enum FileConstants {\n+        static let addToCartActionTabViewHeight = 55\n+        static let backgroundGradientScaleHeight: CGFloat = 0.6\n+        static let emptyItemHeight: CGFloat = 156\n+    }\n+    \n+    // MARK: View Lifecycle\n+    override func viewDidLoad() {\n+        super.viewDidLoad()\n+\n+        view.backgroundColor = .white\n+\n+        // Perform once here, then done in viewDidAppear (for popping back to the view)\n+        formatNavigationBar()\n+\n+        title = menuItem.title\n+\n+        // Use the defaults to set the initial selections\n+        optionSectionsMap = menuItem.defaulOptions\n+        \n+        backgroundGradient = CAGradientLayer()\n+        backgroundGradient.colors = [UIColor.sunshine.cgColor, UIColor.butterscotch.cgColor]\n+        backgroundGradient.locations = [0, 1]\n+        backgroundGradient.startPoint = CGPoint(x: 0, y: 0)\n+        backgroundGradient.endPoint = CGPoint(x: 1, y: 0.5)\n+        backgroundGradient.frame = CGRect(x: 0, y: 0, width: view.frame.width, height: FileConstants.backgroundGradientScaleHeight * view.frame.height)\n+        view.layer.addSublayer(backgroundGradient)\n+\n+        addToCartActionTabView = ActionTabView(frame: .zero, title: \"Add to Cart\", price: menuItem.price)\n+        view.addSubview(addToCartActionTabView)\n+        \n+        addToCartTapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(addToCart))\n+        addToCartActionTabView.addGestureRecognizer(addToCartTapGestureRecognizer)\n+        \n+        bottomFillerRect = UIView()\n+        bottomFillerRect.backgroundColor = .acaiBlack\n+        view.addSubview(bottomFillerRect)\n+        \n+        let layout = UICollectionViewFlowLayout()\n+        layout.scrollDirection = .vertical\n+        collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)\n+        collectionView.backgroundColor = .clear\n+        collectionView.showsVerticalScrollIndicator = false\n+        collectionView.alwaysBounceVertical = true\n+        view.addSubview(collectionView)\n+        \n+        listAdapter = ListAdapter(updater: ListAdapterUpdater(), viewController: self, workingRangeSize: 0)\n+        listAdapter.collectionView = collectionView\n+        listAdapter.dataSource = self\n+\n+        setupConstraints()\n+    }\n+\n+    override func viewDidAppear(_ animated: Bool) {\n+        super.viewDidAppear(animated)\n+        ","path":"acai-ios/OrderDetailViewController.swift","position":93,"original_position":93,"commit_id":"a84aaae95131f1ed3f5964e9b4834ebba00ff9fc","original_commit_id":"a84aaae95131f1ed3f5964e9b4834ebba00ff9fc","user":{"login":"YKo20010","id":43295248,"node_id":"MDQ6VXNlcjQzMjk1MjQ4","avatar_url":"https://avatars2.githubusercontent.com/u/43295248?v=4","gravatar_id":"","url":"https://api.github.com/users/YKo20010","html_url":"https://github.com/YKo20010","followers_url":"https://api.github.com/users/YKo20010/followers","following_url":"https://api.github.com/users/YKo20010/following{/other_user}","gists_url":"https://api.github.com/users/YKo20010/gists{/gist_id}","starred_url":"https://api.github.com/users/YKo20010/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YKo20010/subscriptions","organizations_url":"https://api.github.com/users/YKo20010/orgs","repos_url":"https://api.github.com/users/YKo20010/repos","events_url":"https://api.github.com/users/YKo20010/events{/privacy}","received_events_url":"https://api.github.com/users/YKo20010/received_events","type":"User","site_admin":false},"body":"should this newline be deleted?","created_at":"2019-03-27T21:31:53Z","updated_at":"2019-03-27T21:39:15Z","html_url":"https://github.com/cuappdev/acai-ios/pull/26#discussion_r269779228","pull_request_url":"https://api.github.com/repos/cuappdev/acai-ios/pulls/26","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/cuappdev/acai-ios/pulls/comments/269779228"},"html":{"href":"https://github.com/cuappdev/acai-ios/pull/26#discussion_r269779228"},"pull_request":{"href":"https://api.github.com/repos/cuappdev/acai-ios/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/cuappdev/acai-ios/pulls/26","id":263931873,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYzOTMxODcz","html_url":"https://github.com/cuappdev/acai-ios/pull/26","diff_url":"https://github.com/cuappdev/acai-ios/pull/26.diff","patch_url":"https://github.com/cuappdev/acai-ios/pull/26.patch","issue_url":"https://api.github.com/repos/cuappdev/acai-ios/issues/26","number":26,"state":"open","locked":false,"title":"Yanlam/reorganize detail view","user":{"login":"YKo20010","id":43295248,"node_id":"MDQ6VXNlcjQzMjk1MjQ4","avatar_url":"https://avatars2.githubusercontent.com/u/43295248?v=4","gravatar_id":"","url":"https://api.github.com/users/YKo20010","html_url":"https://github.com/YKo20010","followers_url":"https://api.github.com/users/YKo20010/followers","following_url":"https://api.github.com/users/YKo20010/following{/other_user}","gists_url":"https://api.github.com/users/YKo20010/gists{/gist_id}","starred_url":"https://api.github.com/users/YKo20010/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YKo20010/subscriptions","organizations_url":"https://api.github.com/users/YKo20010/orgs","repos_url":"https://api.github.com/users/YKo20010/repos","events_url":"https://api.github.com/users/YKo20010/events{/privacy}","received_events_url":"https://api.github.com/users/YKo20010/received_events","type":"User","site_admin":false},"body":"can get rid of HeaderItem and HeaderListSectionController now; create OptionHeaderCollectionViewCell through OrderCustomizationListSectionController","created_at":"2019-03-24T19:57:08Z","updated_at":"2019-03-27T21:39:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af7579100ab0a514d2b46cd8a0a1782b25914e82","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cuappdev/acai-ios/pulls/26/commits","review_comments_url":"https://api.github.com/repos/cuappdev/acai-ios/pulls/26/comments","review_comment_url":"https://api.github.com/repos/cuappdev/acai-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cuappdev/acai-ios/issues/26/comments","statuses_url":"https://api.github.com/repos/cuappdev/acai-ios/statuses/a84aaae95131f1ed3f5964e9b4834ebba00ff9fc","head":{"label":"cuappdev:yanlam/reorganize-detail-view","ref":"yanlam/reorganize-detail-view","sha":"a84aaae95131f1ed3f5964e9b4834ebba00ff9fc","user":{"login":"cuappdev","id":17533691,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NTMzNjkx","avatar_url":"https://avatars0.githubusercontent.com/u/17533691?v=4","gravatar_id":"","url":"https://api.github.com/users/cuappdev","html_url":"https://github.com/cuappdev","followers_url":"https://api.github.com/users/cuappdev/followers","following_url":"https://api.github.com/users/cuappdev/following{/other_user}","gists_url":"https://api.github.com/users/cuappdev/gists{/gist_id}","starred_url":"https://api.github.com/users/cuappdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuappdev/subscriptions","organizations_url":"https://api.github.com/users/cuappdev/orgs","repos_url":"https://api.github.com/users/cuappdev/repos","events_url":"https://api.github.com/users/cuappdev/events{/privacy}","received_events_url":"https://api.github.com/users/cuappdev/received_events","type":"Organization","site_admin":false},"repo":{"id":170589579,"node_id":"MDEwOlJlcG9zaXRvcnkxNzA1ODk1Nzk=","name":"acai-ios","full_name":"cuappdev/acai-ios","private":false,"owner":{"login":"cuappdev","id":17533691,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NTMzNjkx","avatar_url":"https://avatars0.githubusercontent.com/u/17533691?v=4","gravatar_id":"","url":"https://api.github.com/users/cuappdev","html_url":"https://github.com/cuappdev","followers_url":"https://api.github.com/users/cuappdev/followers","following_url":"https://api.github.com/users/cuappdev/following{/other_user}","gists_url":"https://api.github.com/users/cuappdev/gists{/gist_id}","starred_url":"https://api.github.com/users/cuappdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuappdev/subscriptions","organizations_url":"https://api.github.com/users/cuappdev/orgs","repos_url":"https://api.github.com/users/cuappdev/repos","events_url":"https://api.github.com/users/cuappdev/events{/privacy}","received_events_url":"https://api.github.com/users/cuappdev/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/cuappdev/acai-ios","description":"Acai app. Mobile Macha","fork":false,"url":"https://api.github.com/repos/cuappdev/acai-ios","forks_url":"https://api.github.com/repos/cuappdev/acai-ios/forks","keys_url":"https://api.github.com/repos/cuappdev/acai-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cuappdev/acai-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cuappdev/acai-ios/teams","hooks_url":"https://api.github.com/repos/cuappdev/acai-ios/hooks","issue_events_url":"https://api.github.com/repos/cuappdev/acai-ios/issues/events{/number}","events_url":"https://api.github.com/repos/cuappdev/acai-ios/events","assignees_url":"https://api.github.com/repos/cuappdev/acai-ios/assignees{/user}","branches_url":"https://api.github.com/repos/cuappdev/acai-ios/branches{/branch}","tags_url":"https://api.github.com/repos/cuappdev/acai-ios/tags","blobs_url":"https://api.github.com/repos/cuappdev/acai-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cuappdev/acai-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cuappdev/acai-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/cuappdev/acai-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cuappdev/acai-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/cuappdev/acai-ios/languages","stargazers_url":"https://api.github.com/repos/cuappdev/acai-ios/stargazers","contributors_url":"https://api.github.com/repos/cuappdev/acai-ios/contributors","subscribers_url":"https://api.github.com/repos/cuappdev/acai-ios/subscribers","subscription_url":"https://api.github.com/repos/cuappdev/acai-ios/subscription","commits_url":"https://api.github.com/repos/cuappdev/acai-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/cuappdev/acai-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/cuappdev/acai-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/cuappdev/acai-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/cuappdev/acai-ios/contents/{+path}","compare_url":"https://api.github.com/repos/cuappdev/acai-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cuappdev/acai-ios/merges","archive_url":"https://api.github.com/repos/cuappdev/acai-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cuappdev/acai-ios/downloads","issues_url":"https://api.github.com/repos/cuappdev/acai-ios/issues{/number}","pulls_url":"https://api.github.com/repos/cuappdev/acai-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/cuappdev/acai-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/cuappdev/acai-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cuappdev/acai-ios/labels{/name}","releases_url":"https://api.github.com/repos/cuappdev/acai-ios/releases{/id}","deployments_url":"https://api.github.com/repos/cuappdev/acai-ios/deployments","created_at":"2019-02-13T22:31:22Z","updated_at":"2019-03-26T20:56:47Z","pushed_at":"2019-03-27T21:11:44Z","git_url":"git://github.com/cuappdev/acai-ios.git","ssh_url":"git@github.com:cuappdev/acai-ios.git","clone_url":"https://github.com/cuappdev/acai-ios.git","svn_url":"https://github.com/cuappdev/acai-ios","homepage":null,"size":30541,"stargazers_count":2,"watchers_count":2,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":4,"watchers":2,"default_branch":"master"}},"base":{"label":"cuappdev:master","ref":"master","sha":"45492ba335dcccb461c2390330738f2eb902c571","user":{"login":"cuappdev","id":17533691,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NTMzNjkx","avatar_url":"https://avatars0.githubusercontent.com/u/17533691?v=4","gravatar_id":"","url":"https://api.github.com/users/cuappdev","html_url":"https://github.com/cuappdev","followers_url":"https://api.github.com/users/cuappdev/followers","following_url":"https://api.github.com/users/cuappdev/following{/other_user}","gists_url":"https://api.github.com/users/cuappdev/gists{/gist_id}","starred_url":"https://api.github.com/users/cuappdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuappdev/subscriptions","organizations_url":"https://api.github.com/users/cuappdev/orgs","repos_url":"https://api.github.com/users/cuappdev/repos","events_url":"https://api.github.com/users/cuappdev/events{/privacy}","received_events_url":"https://api.github.com/users/cuappdev/received_events","type":"Organization","site_admin":false},"repo":{"id":170589579,"node_id":"MDEwOlJlcG9zaXRvcnkxNzA1ODk1Nzk=","name":"acai-ios","full_name":"cuappdev/acai-ios","private":false,"owner":{"login":"cuappdev","id":17533691,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NTMzNjkx","avatar_url":"https://avatars0.githubusercontent.com/u/17533691?v=4","gravatar_id":"","url":"https://api.github.com/users/cuappdev","html_url":"https://github.com/cuappdev","followers_url":"https://api.github.com/users/cuappdev/followers","following_url":"https://api.github.com/users/cuappdev/following{/other_user}","gists_url":"https://api.github.com/users/cuappdev/gists{/gist_id}","starred_url":"https://api.github.com/users/cuappdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuappdev/subscriptions","organizations_url":"https://api.github.com/users/cuappdev/orgs","repos_url":"https://api.github.com/users/cuappdev/repos","events_url":"https://api.github.com/users/cuappdev/events{/privacy}","received_events_url":"https://api.github.com/users/cuappdev/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/cuappdev/acai-ios","description":"Acai app. Mobile Macha","fork":false,"url":"https://api.github.com/repos/cuappdev/acai-ios","forks_url":"https://api.github.com/repos/cuappdev/acai-ios/forks","keys_url":"https://api.github.com/repos/cuappdev/acai-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cuappdev/acai-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cuappdev/acai-ios/teams","hooks_url":"https://api.github.com/repos/cuappdev/acai-ios/hooks","issue_events_url":"https://api.github.com/repos/cuappdev/acai-ios/issues/events{/number}","events_url":"https://api.github.com/repos/cuappdev/acai-ios/events","assignees_url":"https://api.github.com/repos/cuappdev/acai-ios/assignees{/user}","branches_url":"https://api.github.com/repos/cuappdev/acai-ios/branches{/branch}","tags_url":"https://api.github.com/repos/cuappdev/acai-ios/tags","blobs_url":"https://api.github.com/repos/cuappdev/acai-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cuappdev/acai-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cuappdev/acai-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/cuappdev/acai-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cuappdev/acai-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/cuappdev/acai-ios/languages","stargazers_url":"https://api.github.com/repos/cuappdev/acai-ios/stargazers","contributors_url":"https://api.github.com/repos/cuappdev/acai-ios/contributors","subscribers_url":"https://api.github.com/repos/cuappdev/acai-ios/subscribers","subscription_url":"https://api.github.com/repos/cuappdev/acai-ios/subscription","commits_url":"https://api.github.com/repos/cuappdev/acai-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/cuappdev/acai-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/cuappdev/acai-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/cuappdev/acai-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/cuappdev/acai-ios/contents/{+path}","compare_url":"https://api.github.com/repos/cuappdev/acai-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cuappdev/acai-ios/merges","archive_url":"https://api.github.com/repos/cuappdev/acai-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cuappdev/acai-ios/downloads","issues_url":"https://api.github.com/repos/cuappdev/acai-ios/issues{/number}","pulls_url":"https://api.github.com/repos/cuappdev/acai-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/cuappdev/acai-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/cuappdev/acai-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cuappdev/acai-ios/labels{/name}","releases_url":"https://api.github.com/repos/cuappdev/acai-ios/releases{/id}","deployments_url":"https://api.github.com/repos/cuappdev/acai-ios/deployments","created_at":"2019-02-13T22:31:22Z","updated_at":"2019-03-26T20:56:47Z","pushed_at":"2019-03-27T21:11:44Z","git_url":"git://github.com/cuappdev/acai-ios.git","ssh_url":"git@github.com:cuappdev/acai-ios.git","clone_url":"https://github.com/cuappdev/acai-ios.git","svn_url":"https://github.com/cuappdev/acai-ios","homepage":null,"size":30541,"stargazers_count":2,"watchers_count":2,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cuappdev/acai-ios/pulls/26"},"html":{"href":"https://github.com/cuappdev/acai-ios/pull/26"},"issue":{"href":"https://api.github.com/repos/cuappdev/acai-ios/issues/26"},"comments":{"href":"https://api.github.com/repos/cuappdev/acai-ios/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/cuappdev/acai-ios/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/cuappdev/acai-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cuappdev/acai-ios/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/cuappdev/acai-ios/statuses/a84aaae95131f1ed3f5964e9b4834ebba00ff9fc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"YKo20010"}}