Add suggested passwords in AutoFill

This commit is contained in:
Mingshen Sun 2021-01-02 22:13:48 -08:00
parent 156588bd93
commit d4669bbfcb
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
4 changed files with 94 additions and 6 deletions

View file

@ -27,18 +27,27 @@ class PasswordsViewController: UIViewController {
return uiSearchController
}()
lazy var searchBar: UISearchBar = {
self.searchController.searchBar
}()
override func viewDidLoad() {
super.viewDidLoad()
navigationItem.searchController = searchController
navigationItem.hidesSearchBarWhenScrolling = false
searchController.searchBar.delegate = self
searchBar.delegate = self
tableView.delegate = self
tableView.dataSource = dataSource
}
func showPasswordsWithSuggstion(_ keywords: [String]) {
dataSource.showTableEntriesWithSuggestion(matching: keywords)
tableView.reloadData()
}
@IBAction
private func cancel(_: AnyObject?) {
self.extensionContext?.cancelRequest(withError: NSError(domain: ASExtensionErrorDomain, code: ASExtensionError.userCanceled.rawValue))