Set navigation controller title as folder name
This commit is contained in:
parent
853ea547e2
commit
301309f0cc
1 changed files with 9 additions and 2 deletions
|
|
@ -321,11 +321,17 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
|
||||||
}
|
}
|
||||||
|
|
||||||
private func setNavigationItemTitle() {
|
private func setNavigationItemTitle() {
|
||||||
|
var title = ""
|
||||||
|
if parentPasswordEntity != nil {
|
||||||
|
title = parentPasswordEntity!.name!
|
||||||
|
} else {
|
||||||
|
title = "Password Store"
|
||||||
|
}
|
||||||
let numberOfUnsynced = PasswordStore.shared.getNumberOfUnsyncedPasswords()
|
let numberOfUnsynced = PasswordStore.shared.getNumberOfUnsyncedPasswords()
|
||||||
if numberOfUnsynced == 0 {
|
if numberOfUnsynced == 0 {
|
||||||
navigationItem.title = "Password Store"
|
navigationItem.title = "\(title)"
|
||||||
} else {
|
} else {
|
||||||
navigationItem.title = "Password Store (\(numberOfUnsynced))"
|
navigationItem.title = "\(title) (\(numberOfUnsynced))"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -382,6 +388,7 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
|
||||||
}
|
}
|
||||||
|
|
||||||
func reloadTableView(data: [PasswordsTableEntry]) {
|
func reloadTableView(data: [PasswordsTableEntry]) {
|
||||||
|
setNavigationItemTitle()
|
||||||
if parentPasswordEntity != nil {
|
if parentPasswordEntity != nil {
|
||||||
navigationItem.leftBarButtonItem = backUIBarButtonItem
|
navigationItem.leftBarButtonItem = backUIBarButtonItem
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue