From 5a0b97b22fec6a36716559e9311bf31358f5f013 Mon Sep 17 00:00:00 2001 From: Bob Sun Date: Sat, 4 Feb 2017 20:56:16 +0800 Subject: [PATCH] show all additional information --- pass/PasswordDetailTableViewController.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pass/PasswordDetailTableViewController.swift b/pass/PasswordDetailTableViewController.swift index abd064e..997cd55 100644 --- a/pass/PasswordDetailTableViewController.swift +++ b/pass/PasswordDetailTableViewController.swift @@ -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)) + } } }