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)
|
||||
} else if selectedCell == scanQRCodeCell {
|
||||
self.performSegue(withIdentifier: "showQRScannerSegue", sender: self)
|
||||
} else if selectedCell == passwordFlavorCell {
|
||||
showPasswordGeneratorFlavorActionSheet(sourceCell: selectedCell!, tableView: tableView)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -265,33 +263,6 @@ class PasswordEditorTableViewController: UITableViewController {
|
|||
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) {
|
||||
// Remove delimiter configuration for XKCD style passwords. Re-add it for random ones.
|
||||
switch flavor {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue