diff --git a/pass/Controllers/EditPasswordTableViewController.swift b/pass/Controllers/EditPasswordTableViewController.swift index 80fd504..c767150 100644 --- a/pass/Controllers/EditPasswordTableViewController.swift +++ b/pass/Controllers/EditPasswordTableViewController.swift @@ -19,6 +19,8 @@ class EditPasswordTableViewController: PasswordEditorTableViewController { [[.type: PasswordEditorCellType.textViewCell, .title: "additions", .content: password!.getAdditionsPlainText()]], ] sectionHeaderTitles = ["name", "password", "additions"].map {$0.uppercased()} + sectionFooterTitles = ["", "", "It is recommended to use \"key: value\" format to store additional fields as follows:\n url: https://www.apple.com\n username: passforios@gmail.com."] + super.viewDidLoad() } diff --git a/pass/Controllers/PasswordEditorTableViewController.swift b/pass/Controllers/PasswordEditorTableViewController.swift index bdd5b7b..365cfb2 100644 --- a/pass/Controllers/PasswordEditorTableViewController.swift +++ b/pass/Controllers/PasswordEditorTableViewController.swift @@ -21,6 +21,7 @@ class PasswordEditorTableViewController: UITableViewController { [Dictionary] ]() var sectionHeaderTitles = [String]() + var sectionFooterTitles = [String]() override func viewDidLoad() { super.viewDidLoad() @@ -33,6 +34,8 @@ class PasswordEditorTableViewController: UITableViewController { tableView.rowHeight = UITableViewAutomaticDimension tableView.estimatedRowHeight = 48 tableView.allowsSelection = false + self.tableView.sectionFooterHeight = UITableViewAutomaticDimension; + self.tableView.estimatedSectionFooterHeight = 0; } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { @@ -56,10 +59,6 @@ class PasswordEditorTableViewController: UITableViewController { override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { return 44 } - - override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { - return 0.1 - } override func numberOfSections(in tableView: UITableView) -> Int { return tableData.count @@ -72,6 +71,10 @@ class PasswordEditorTableViewController: UITableViewController { override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { return sectionHeaderTitles[section] } + + override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? { + return sectionFooterTitles[section] + } }