Support selects a credential identity from the QuickType bar

This commit is contained in:
Mingshen Sun 2021-01-03 15:08:15 -08:00
parent d4669bbfcb
commit 29d74c48e5
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
6 changed files with 125 additions and 30 deletions

View file

@ -74,7 +74,16 @@ extension PasswordsViewController: UISearchBarDelegate {
extension PasswordsViewController: UITableViewDelegate {
func tableView(_: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
let entry = dataSource.filteredPasswordsTableEntries[indexPath.row]
var entry: PasswordTableEntry!
if dataSource.showSuggestion {
if indexPath.section == 0 {
entry = dataSource.suggestedPasswordsTableEntries[indexPath.row]
} else {
entry = dataSource.filteredPasswordsTableEntries[indexPath.row]
}
} else {
entry = dataSource.filteredPasswordsTableEntries[indexPath.row]
}
UIImpactFeedbackGenerator(style: .medium).impactOccurred()
self.selectionDelegate?.selected(password: entry)