Fix a bug caused by newly added delete password button

This commit is contained in:
Bob Sun 2017-03-22 19:06:53 -07:00
parent 0c241facd6
commit ac3dbad4dd

View file

@ -40,12 +40,13 @@ class EditPasswordTableViewController: PasswordEditorTableViewController {
var cellContents = [String: String]() var cellContents = [String: String]()
for cell in cells { for cell in cells {
let indexPath = tableView.indexPath(for: cell)! let indexPath = tableView.indexPath(for: cell)!
let contentCell = cell as! ContentTableViewCell if let contentCell = cell as? ContentTableViewCell {
let cellTitle = tableData[indexPath.section][indexPath.row][.title] as! String let cellTitle = tableData[indexPath.section][indexPath.row][.title] as! String
if let cellContent = contentCell.getContent() { if let cellContent = contentCell.getContent() {
cellContents[cellTitle] = cellContent cellContents[cellTitle] = cellContent
} }
} }
}
var plainText = "" var plainText = ""
if cellContents["additions"]! != "" { if cellContents["additions"]! != "" {
plainText = "\(cellContents["password"]!)\n\(cellContents["additions"]!)" plainText = "\(cellContents["password"]!)\n\(cellContents["additions"]!)"