Remove now unused password flavor action sheet
This commit is contained in:
parent
eca4d79178
commit
fda8df70dd
1 changed files with 0 additions and 29 deletions
|
|
@ -255,8 +255,6 @@ class PasswordEditorTableViewController: UITableViewController {
|
||||||
self.present(alert, animated: true, completion: nil)
|
self.present(alert, animated: true, completion: nil)
|
||||||
} else if selectedCell == scanQRCodeCell {
|
} else if selectedCell == scanQRCodeCell {
|
||||||
self.performSegue(withIdentifier: "showQRScannerSegue", sender: self)
|
self.performSegue(withIdentifier: "showQRScannerSegue", sender: self)
|
||||||
} else if selectedCell == passwordFlavorCell {
|
|
||||||
showPasswordGeneratorFlavorActionSheet(sourceCell: selectedCell!, tableView: tableView)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -264,33 +262,6 @@ class PasswordEditorTableViewController: UITableViewController {
|
||||||
super.viewWillDisappear(animated)
|
super.viewWillDisappear(animated)
|
||||||
Defaults.passwordGenerator = passwordGenerator
|
Defaults.passwordGenerator = passwordGenerator
|
||||||
}
|
}
|
||||||
|
|
||||||
private func showPasswordGeneratorFlavorActionSheet(sourceCell: UITableViewCell, tableView: UITableView) {
|
|
||||||
let optionMenu = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
|
|
||||||
|
|
||||||
PasswordGeneratorFlavor.allCases.forEach { flavor in
|
|
||||||
var actionTitle = flavor.longNameLocalized
|
|
||||||
if passwordGenerator.flavor == flavor {
|
|
||||||
actionTitle = "✓ " + actionTitle
|
|
||||||
}
|
|
||||||
let action = UIAlertAction(title: actionTitle, style: .default) { _ in
|
|
||||||
guard self.passwordGenerator.flavor != flavor else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
self.passwordGenerator.flavor = flavor
|
|
||||||
sourceCell.detailTextLabel?.text = self.passwordGenerator.flavor.localized
|
|
||||||
self.updateTableData(withRespectTo: flavor)
|
|
||||||
tableView.reloadSections([self.passwordSection], with: .none)
|
|
||||||
}
|
|
||||||
optionMenu.addAction(action)
|
|
||||||
}
|
|
||||||
|
|
||||||
let cancelAction = UIAlertAction(title: "Cancel".localize(), style: .cancel, handler: nil)
|
|
||||||
optionMenu.addAction(cancelAction)
|
|
||||||
optionMenu.popoverPresentationController?.sourceView = sourceCell
|
|
||||||
|
|
||||||
self.present(optionMenu, animated: true, completion: nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
private func updateTableData(withRespectTo flavor: PasswordGeneratorFlavor) {
|
private func updateTableData(withRespectTo flavor: PasswordGeneratorFlavor) {
|
||||||
// Remove delimiter configuration for XKCD style passwords. Re-add it for random ones.
|
// Remove delimiter configuration for XKCD style passwords. Re-add it for random ones.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue