show all additional information

This commit is contained in:
Bob Sun 2017-02-04 20:56:16 +08:00
parent 2632169427
commit 5a0b97b22f
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -27,16 +27,21 @@ class PasswordDetailTableViewController: UITableViewController {
super.viewDidLoad()
tableView.register(UINib(nibName: "LabelTableViewCell", bundle: nil), forCellReuseIdentifier: "labelCell")
let password = passwordEntity!.decrypt()!
var tableDataIndex = 0
tableData.append(TableSection(title: "", item: []))
if let username = password.additions["Username"] {
tableData[0].item.append(TableCell(title: "username", content: username))
tableData[tableDataIndex].item.append(TableCell(title: "username", content: username))
password.additions.removeValue(forKey: "Username")
}
tableData[0].item.append(TableCell(title: "password", content: password.password))
tableData[tableDataIndex].item.append(TableCell(title: "password", content: password.password))
if password.additions.count > 0 {
tableData.append(TableSection(title: "additions", item: []))
tableDataIndex += 1
for (key, value) in password.additions {
tableData[tableDataIndex].item.append(TableCell(title: key, content: value))
}
}
}