Add support for removing a site
This commit is contained in:
parent
43adab7b39
commit
c7872db0ba
3 changed files with 35 additions and 1 deletions
|
@ -183,4 +183,29 @@ clearNSMutableString(NSMutableString *string)
|
|||
|
||||
return password;
|
||||
}
|
||||
|
||||
- (IBAction)remove: (id)sender
|
||||
{
|
||||
UIAlertController *alert = [UIAlertController
|
||||
alertControllerWithTitle: @"Remove Site?"
|
||||
message: @"Do you want to remove this site?"
|
||||
preferredStyle: UIAlertControllerStyleAlert];
|
||||
[alert addAction:
|
||||
[UIAlertAction actionWithTitle: @"No"
|
||||
style: UIAlertActionStyleCancel
|
||||
handler: nil]];
|
||||
[alert addAction:
|
||||
[UIAlertAction actionWithTitle: @"Yes"
|
||||
style: UIAlertActionStyleDestructive
|
||||
handler: ^ (UIAlertAction *action) {
|
||||
[self.mainViewController.siteStorage removeSite: _name];
|
||||
[self.mainViewController.tableView reloadData];
|
||||
|
||||
[self.navigationController popViewControllerAnimated: YES];
|
||||
}]];
|
||||
|
||||
[self presentViewController: alert
|
||||
animated: YES
|
||||
completion: nil];
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue