clear pasteboard after 45 seconds

This commit is contained in:
yishilin14 2017-02-23 17:56:12 +08:00
parent e1f3a08666
commit 2f3ccc9c07
4 changed files with 16 additions and 4 deletions

View file

@ -252,7 +252,7 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
override func tableView(_ tableView: UITableView, performAction action: Selector, forRowAt indexPath: IndexPath, withSender sender: Any?) {
if action == #selector(copy(_:)) {
UIPasteboard.general.string = tableData[indexPath.section].item[indexPath.row].content
Utils.copyToPasteboard(textToCopy: tableData[indexPath.section].item[indexPath.row].content)
}
}

View file

@ -198,7 +198,7 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
do {
decryptedPassword = try password.decrypt()!
DispatchQueue.main.async {
UIPasteboard.general.string = decryptedPassword?.password
Utils.copyToPasteboard(textToCopy: decryptedPassword?.password)
SVProgressHUD.showSuccess(withStatus: "Password Copied")
SVProgressHUD.dismiss(withDelay: 0.6)
}