add erase data function
This commit is contained in:
parent
373c6500f0
commit
e2a2774664
6 changed files with 173 additions and 12 deletions
|
|
@ -55,6 +55,8 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
|
|||
super.viewDidLoad()
|
||||
passwordEntities = PasswordStore.shared.fetchPasswordEntityCoreData()
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(PasswordsViewController.actOnPasswordUpdatedNotification), name: NSNotification.Name(rawValue: "passwordUpdated"), object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(PasswordsViewController.actOnPasswordStoreErasedNotification), name: NSNotification.Name(rawValue: "passwordStoreErased"), object: nil)
|
||||
|
||||
generateSections(item: passwordEntities!)
|
||||
tableView.delegate = self
|
||||
tableView.dataSource = self
|
||||
|
|
@ -160,6 +162,13 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
|
|||
print("actOnPasswordUpdatedNotification")
|
||||
}
|
||||
|
||||
func actOnPasswordStoreErasedNotification() {
|
||||
passwordEntities = PasswordStore.shared.fetchPasswordEntityCoreData()
|
||||
reloadTableView(data: passwordEntities!)
|
||||
print("actOnPasswordErasedNotification")
|
||||
}
|
||||
|
||||
|
||||
override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool {
|
||||
if identifier == "showPasswordDetail" {
|
||||
if Defaults[.pgpKeyID] == "" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue