Add support for removing a site

This commit is contained in:
Jonathan Schleifer 2016-10-09 18:37:48 +02:00
parent 43adab7b39
commit c7872db0ba
No known key found for this signature in database
GPG key ID: 338C3541DB54E169
3 changed files with 35 additions and 1 deletions

View file

@ -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