Polish notification
- define notification names - move "post notification" to PasswordStore (todo: move "search" and the one for "show folder switch") - "erase" and "reset" also post the "passwordStoreUpdated" notification
This commit is contained in:
parent
0ad9713fc0
commit
1f829fffcc
11 changed files with 41 additions and 29 deletions
|
|
@ -32,7 +32,9 @@ class AboutRepositoryTableViewController: BasicStaticTableViewController {
|
|||
tableView.addSubview(indicatorLabel)
|
||||
|
||||
setTableData()
|
||||
addNotificationObservers()
|
||||
|
||||
// all password store updates (including erase, discard) will trigger the refresh
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(setNeedRefresh), name: .passwordStoreUpdated, object: nil)
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
|
|
@ -92,11 +94,6 @@ class AboutRepositoryTableViewController: BasicStaticTableViewController {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func addNotificationObservers() {
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(setNeedRefresh), name: NSNotification.Name(rawValue: "passwordUpdated"), object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(setNeedRefresh), name: NSNotification.Name(rawValue: "passwordStoreErased"), object: nil)
|
||||
}
|
||||
|
||||
func setNeedRefresh() {
|
||||
needRefresh = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue