only prepare saveEditPasswordSegue

This commit is contained in:
Bob Sun 2017-02-13 11:42:28 +08:00
parent 286f90b92e
commit ae93727c6b
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -39,15 +39,17 @@ class EditPasswordTableViewController: PasswordEditorTableViewController {
} }
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let cells = tableView.visibleCells if segue.identifier == "saveEditPasswordSegue" {
var cellContents = [String: String]() let cells = tableView.visibleCells
for cell in cells { var cellContents = [String: String]()
let indexPath = tableView.indexPath(for: cell)! for cell in cells {
let contentCell = cell as! ContentTableViewCell let indexPath = tableView.indexPath(for: cell)!
let cellTitle = tableData[indexPath.section][indexPath.row][.title] as! String let contentCell = cell as! ContentTableViewCell
cellContents[cellTitle] = contentCell.getContent()! let cellTitle = tableData[indexPath.section][indexPath.row][.title] as! String
cellContents[cellTitle] = contentCell.getContent()!
}
password!.updatePassword(name: cellContents["name"]!, plainText: "\(cellContents["password"]!)\n\(cellContents["additions"]!)")
} }
password!.updatePassword(name: cellContents["name"]!, plainText: "\(cellContents["password"]!)\n\(cellContents["additions"]!)")
} }
} }