{"action":"created","comment":{"url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/pulls/comments/228482061","pull_request_review_id":168765902,"id":228482061,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODQ4MjA2MQ==","diff_hunk":"@@ -0,0 +1,165 @@\n+//\n+//  SendMoneroPaymentId.swift\n+//  WavesWallet-iOS\n+//\n+//  Created by Pavel Gubin on 10/24/18.\n+//  Copyright © 2018 Waves Platform. All rights reserved.\n+//\n+\n+import UIKit\n+\n+private enum Constants {\n+    static let paymentIdLength = 64\n+    static let animationDuration: TimeInterval = 0.3\n+    static let viewHeight: CGFloat = 98\n+}\n+\n+\n+final class SendMoneroPaymentIdView: UIView, NibOwnerLoadable {\n+\n+    @IBOutlet private weak var labelMoneroPayment: UILabel!\n+    @IBOutlet private weak var labelError: UILabel!\n+    @IBOutlet private weak var viewContainer: UIView!\n+    @IBOutlet private weak var textField: UITextField!\n+    \n+    private var isShowError = false\n+    private var hasErrorFromServer = false\n+    \n+    var didTapNext:(() -> Void)?\n+    var paymentIdDidChange:((String) -> Void)?\n+    \n+    required init?(coder aDecoder: NSCoder) {\n+        super.init(coder: aDecoder)\n+        loadNibContent()\n+    }\n+    \n+    override func awakeFromNib() {\n+        super.awakeFromNib()\n+        labelError.alpha = 0\n+        setupLocalization()\n+        viewContainer.addTableCellShadowStyle()\n+        setupDefaultHeight(animation: false)\n+    }\n+  \n+    var isVisible: Bool {\n+        return heightConstraint.constant > 0\n+    }\n+    \n+    func setupDefaultHeight(animation: Bool) {\n+        heightConstraint.constant = Constants.viewHeight\n+        \n+        if animation {\n+            UIView.animate(withDuration: Constants.animationDuration) {\n+                self.firstAvailableViewController().view.layoutIfNeeded()\n+            }\n+        }\n+    }\n+    \n+    func setupZeroHeight(animation: Bool) {\n+        showError(false, animation: animation)\n+        heightConstraint.constant = 0\n+        if animation {\n+            UIView.animate(withDuration: Constants.animationDuration, animations: {\n+                self.firstAvailableViewController().view.layoutIfNeeded()\n+            }) { (_) in\n+                self.textField.text = nil\n+            }\n+        }\n+        else {\n+            textField.text = nil\n+        }\n+    }\n+    \n+    func activateTextField() {\n+        textField.becomeFirstResponder()\n+    }\n+    \n+    var paymentID: String {\n+        return textField.text?.trimmingCharacters(in: CharacterSet.whitespaces) ?? \"\"\n+    }\n+    \n+    var isValidPaymentID: Bool {\n+        return paymentID.count == Constants.paymentIdLength && !hasErrorFromServer\n+    }\n+    \n+    func showError() {\n+        hasErrorFromServer = true\n+        showError(true, animation: true)\n+    }\n+    \n+    @IBAction private func textFieldDidChange(_ sender: Any) {\n+        \n+        hasErrorFromServer = false\n+        paymentIdDidChange?(paymentID)\n+        showError(false, animation: true)\n+    }\n+    \n+}\n+\n+//MARK: - UITextFieldDelegate\n+extension SendMoneroPaymentIdView: UITextFieldDelegate {\n+    \n+    func textFieldShouldReturn(_ textField: UITextField) -> Bool {\n+        didTapNext?()\n+        return true\n+    }\n+    \n+    func textFieldDidEndEditing(_ textField: UITextField) {\n+        let isShow = (paymentID.count != Constants.paymentIdLength && paymentID.count > 0) || hasErrorFromServer\n+        showError(isShow, animation: true)\n+    }\n+}\n+\n+//MARK: - UI\n+private extension SendMoneroPaymentIdView {\n+    \n+    func showError(_ isShow: Bool, animation: Bool) {\n+        \n+        if isShow {","path":"WavesWallet-iOS/PresentationLayer/Send/Send/Views/SendMoneroPaymentIdView.swift","position":118,"original_position":118,"commit_id":"35f945eaa8138b50ed63f548c99c7fad50fcf30c","original_commit_id":"35f945eaa8138b50ed63f548c99c7fad50fcf30c","user":{"login":"mefilt","id":1247906,"node_id":"MDQ6VXNlcjEyNDc5MDY=","avatar_url":"https://avatars0.githubusercontent.com/u/1247906?v=4","gravatar_id":"","url":"https://api.github.com/users/mefilt","html_url":"https://github.com/mefilt","followers_url":"https://api.github.com/users/mefilt/followers","following_url":"https://api.github.com/users/mefilt/following{/other_user}","gists_url":"https://api.github.com/users/mefilt/gists{/gist_id}","starred_url":"https://api.github.com/users/mefilt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mefilt/subscriptions","organizations_url":"https://api.github.com/users/mefilt/orgs","repos_url":"https://api.github.com/users/mefilt/repos","events_url":"https://api.github.com/users/mefilt/events{/privacy}","received_events_url":"https://api.github.com/users/mefilt/received_events","type":"User","site_admin":false},"body":"Что то сложный код разбей на методы","created_at":"2018-10-26T10:40:26Z","updated_at":"2018-10-26T10:40:26Z","html_url":"https://github.com/wavesplatform/WavesWallet-iOS/pull/35#discussion_r228482061","pull_request_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/pulls/35","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/pulls/comments/228482061"},"html":{"href":"https://github.com/wavesplatform/WavesWallet-iOS/pull/35#discussion_r228482061"},"pull_request":{"href":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/pulls/35","id":225484119,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1NDg0MTE5","html_url":"https://github.com/wavesplatform/WavesWallet-iOS/pull/35","diff_url":"https://github.com/wavesplatform/WavesWallet-iOS/pull/35.diff","patch_url":"https://github.com/wavesplatform/WavesWallet-iOS/pull/35.patch","issue_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/issues/35","number":35,"state":"open","locked":false,"title":"Feature/ios 126 new","user":{"login":"xdozorx","id":1508816,"node_id":"MDQ6VXNlcjE1MDg4MTY=","avatar_url":"https://avatars0.githubusercontent.com/u/1508816?v=4","gravatar_id":"","url":"https://api.github.com/users/xdozorx","html_url":"https://github.com/xdozorx","followers_url":"https://api.github.com/users/xdozorx/followers","following_url":"https://api.github.com/users/xdozorx/following{/other_user}","gists_url":"https://api.github.com/users/xdozorx/gists{/gist_id}","starred_url":"https://api.github.com/users/xdozorx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xdozorx/subscriptions","organizations_url":"https://api.github.com/users/xdozorx/orgs","repos_url":"https://api.github.com/users/xdozorx/repos","events_url":"https://api.github.com/users/xdozorx/events{/privacy}","received_events_url":"https://api.github.com/users/xdozorx/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-24T17:14:57Z","updated_at":"2018-10-26T10:40:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b4da9585dd97c142fd9d97fe92fb2fc693b9a09","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/pulls/35/commits","review_comments_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/pulls/35/comments","review_comment_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/issues/35/comments","statuses_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/statuses/35f945eaa8138b50ed63f548c99c7fad50fcf30c","head":{"label":"wavesplatform:feature/IOS-126-NEW","ref":"feature/IOS-126-NEW","sha":"35f945eaa8138b50ed63f548c99c7fad50fcf30c","user":{"login":"wavesplatform","id":18295288,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4Mjk1Mjg4","avatar_url":"https://avatars1.githubusercontent.com/u/18295288?v=4","gravatar_id":"","url":"https://api.github.com/users/wavesplatform","html_url":"https://github.com/wavesplatform","followers_url":"https://api.github.com/users/wavesplatform/followers","following_url":"https://api.github.com/users/wavesplatform/following{/other_user}","gists_url":"https://api.github.com/users/wavesplatform/gists{/gist_id}","starred_url":"https://api.github.com/users/wavesplatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wavesplatform/subscriptions","organizations_url":"https://api.github.com/users/wavesplatform/orgs","repos_url":"https://api.github.com/users/wavesplatform/repos","events_url":"https://api.github.com/users/wavesplatform/events{/privacy}","received_events_url":"https://api.github.com/users/wavesplatform/received_events","type":"Organization","site_admin":false},"repo":{"id":139603017,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk2MDMwMTc=","name":"WavesWallet-iOS","full_name":"wavesplatform/WavesWallet-iOS","private":false,"owner":{"login":"wavesplatform","id":18295288,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4Mjk1Mjg4","avatar_url":"https://avatars1.githubusercontent.com/u/18295288?v=4","gravatar_id":"","url":"https://api.github.com/users/wavesplatform","html_url":"https://github.com/wavesplatform","followers_url":"https://api.github.com/users/wavesplatform/followers","following_url":"https://api.github.com/users/wavesplatform/following{/other_user}","gists_url":"https://api.github.com/users/wavesplatform/gists{/gist_id}","starred_url":"https://api.github.com/users/wavesplatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wavesplatform/subscriptions","organizations_url":"https://api.github.com/users/wavesplatform/orgs","repos_url":"https://api.github.com/users/wavesplatform/repos","events_url":"https://api.github.com/users/wavesplatform/events{/privacy}","received_events_url":"https://api.github.com/users/wavesplatform/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/wavesplatform/WavesWallet-iOS","description":"Waves Wallet on iOS","fork":false,"url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS","forks_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/forks","keys_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/teams","hooks_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/hooks","issue_events_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/events","assignees_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/tags","blobs_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/languages","stargazers_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/stargazers","contributors_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/contributors","subscribers_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/subscribers","subscription_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/subscription","commits_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/merges","archive_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/downloads","issues_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/labels{/name}","releases_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/releases{/id}","deployments_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/deployments","created_at":"2018-07-03T15:24:58Z","updated_at":"2018-10-25T15:17:50Z","pushed_at":"2018-10-26T10:21:13Z","git_url":"git://github.com/wavesplatform/WavesWallet-iOS.git","ssh_url":"git@github.com:wavesplatform/WavesWallet-iOS.git","clone_url":"https://github.com/wavesplatform/WavesWallet-iOS.git","svn_url":"https://github.com/wavesplatform/WavesWallet-iOS","homepage":null,"size":18521,"stargazers_count":9,"watchers_count":9,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":10,"open_issues":3,"watchers":9,"default_branch":"develop"}},"base":{"label":"wavesplatform:develop","ref":"develop","sha":"bc2c8c763eed0c4e05e47683b458dc1f2521ec83","user":{"login":"wavesplatform","id":18295288,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4Mjk1Mjg4","avatar_url":"https://avatars1.githubusercontent.com/u/18295288?v=4","gravatar_id":"","url":"https://api.github.com/users/wavesplatform","html_url":"https://github.com/wavesplatform","followers_url":"https://api.github.com/users/wavesplatform/followers","following_url":"https://api.github.com/users/wavesplatform/following{/other_user}","gists_url":"https://api.github.com/users/wavesplatform/gists{/gist_id}","starred_url":"https://api.github.com/users/wavesplatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wavesplatform/subscriptions","organizations_url":"https://api.github.com/users/wavesplatform/orgs","repos_url":"https://api.github.com/users/wavesplatform/repos","events_url":"https://api.github.com/users/wavesplatform/events{/privacy}","received_events_url":"https://api.github.com/users/wavesplatform/received_events","type":"Organization","site_admin":false},"repo":{"id":139603017,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk2MDMwMTc=","name":"WavesWallet-iOS","full_name":"wavesplatform/WavesWallet-iOS","private":false,"owner":{"login":"wavesplatform","id":18295288,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4Mjk1Mjg4","avatar_url":"https://avatars1.githubusercontent.com/u/18295288?v=4","gravatar_id":"","url":"https://api.github.com/users/wavesplatform","html_url":"https://github.com/wavesplatform","followers_url":"https://api.github.com/users/wavesplatform/followers","following_url":"https://api.github.com/users/wavesplatform/following{/other_user}","gists_url":"https://api.github.com/users/wavesplatform/gists{/gist_id}","starred_url":"https://api.github.com/users/wavesplatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wavesplatform/subscriptions","organizations_url":"https://api.github.com/users/wavesplatform/orgs","repos_url":"https://api.github.com/users/wavesplatform/repos","events_url":"https://api.github.com/users/wavesplatform/events{/privacy}","received_events_url":"https://api.github.com/users/wavesplatform/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/wavesplatform/WavesWallet-iOS","description":"Waves Wallet on iOS","fork":false,"url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS","forks_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/forks","keys_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/teams","hooks_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/hooks","issue_events_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/events","assignees_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/tags","blobs_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/languages","stargazers_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/stargazers","contributors_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/contributors","subscribers_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/subscribers","subscription_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/subscription","commits_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/merges","archive_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/downloads","issues_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/labels{/name}","releases_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/releases{/id}","deployments_url":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/deployments","created_at":"2018-07-03T15:24:58Z","updated_at":"2018-10-25T15:17:50Z","pushed_at":"2018-10-26T10:21:13Z","git_url":"git://github.com/wavesplatform/WavesWallet-iOS.git","ssh_url":"git@github.com:wavesplatform/WavesWallet-iOS.git","clone_url":"https://github.com/wavesplatform/WavesWallet-iOS.git","svn_url":"https://github.com/wavesplatform/WavesWallet-iOS","homepage":null,"size":18521,"stargazers_count":9,"watchers_count":9,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":10,"open_issues":3,"watchers":9,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/pulls/35"},"html":{"href":"https://github.com/wavesplatform/WavesWallet-iOS/pull/35"},"issue":{"href":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/issues/35"},"comments":{"href":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/wavesplatform/WavesWallet-iOS/statuses/35f945eaa8138b50ed63f548c99c7fad50fcf30c"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"mefilt"}}