Show number of local commits in tabbar badge instead of title
This commit is contained in:
parent
c7ab350ad8
commit
0f39fa5567
1 changed files with 1 additions and 4 deletions
|
|
@ -499,16 +499,13 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
|
|||
|
||||
private func reloadTableView(data: [PasswordsTableEntry], anim: CAAnimation? = nil) {
|
||||
// set navigation item
|
||||
var numberOfLocalCommitsString = ""
|
||||
let numberOfLocalCommits = self.passwordStore.numberOfLocalCommits()
|
||||
if numberOfLocalCommits > 0 {
|
||||
numberOfLocalCommitsString = " (\(numberOfLocalCommits))"
|
||||
navigationController?.tabBarItem.badgeValue = "\(numberOfLocalCommits)"
|
||||
}
|
||||
if parentPasswordEntity != nil {
|
||||
navigationItem.title = "\(parentPasswordEntity!.name!)\(numberOfLocalCommitsString)"
|
||||
navigationItem.leftBarButtonItem = backUIBarButtonItem
|
||||
} else {
|
||||
navigationItem.title = "Password Store\(numberOfLocalCommitsString)"
|
||||
navigationItem.leftBarButtonItem = nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue