Skip to content

Commit

Permalink
Currency input needed final format
Browse files Browse the repository at this point in the history
  • Loading branch information
SwenVanZanten committed Jan 9, 2019
1 parent bdd44a3 commit 49fb441
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions VergeiOS/Components/UI/Inputs/CurrencyInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ class CurrencyInput: UITextField {
@objc public func editingDidEnd(_ textField: UITextField) {
if getNumber().doubleValue == 0.0 {
textField.text = ""
return
}

// Final Format.
setAmount(getNumber())
}

public func getNumber() -> NSNumber {
Expand Down
2 changes: 1 addition & 1 deletion VergeiOS/Views/Receive/ReceiveViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ReceiveViewController: UIViewController {
addTapRecognizer(target: addressTextField, action: #selector(copyAddress(recognizer:)))
addTapRecognizer(target: xvgCardImageView, action: #selector(copyAddress(recognizer:)))

amountTextField.addTarget(self, action: #selector(amountTextFieldDidChange), for: .editingChanged)
amountTextField.addTarget(self, action: #selector(amountTextFieldDidChange), for: .editingDidEnd)
}

override func viewWillAppear(_ animated: Bool) {
Expand Down

0 comments on commit 49fb441

Please sign in to comment.