Index: iOS/Base.lproj/Main.storyboard
==================================================================
--- iOS/Base.lproj/Main.storyboard
+++ iOS/Base.lproj/Main.storyboard
@@ -400,11 +400,18 @@
-
+
+
+
+
+
+
+
+
Index: iOS/ShowDetailsController.h
==================================================================
--- iOS/ShowDetailsController.h
+++ iOS/ShowDetailsController.h
@@ -35,6 +35,8 @@
@property (retain, nonatomic) IBOutlet UITextField *nameField;
@property (retain, nonatomic) IBOutlet UITextField *lengthField;
@property (retain, nonatomic) IBOutlet UISwitch *legacySwitch;
@property (retain, nonatomic) IBOutlet UITextField *passphraseField;
@property (retain) MainViewController *mainViewController;
+
+- (IBAction)remove: (id)sender;
@end
Index: iOS/ShowDetailsController.m
==================================================================
--- iOS/ShowDetailsController.m
+++ iOS/ShowDetailsController.m
@@ -181,6 +181,31 @@
of_explicit_memset(generator.output, 0,
strlen((char*)generator.output));
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