Rename method
This commit is contained in:
parent
545186da96
commit
b3eef51a9d
6 changed files with 8 additions and 8 deletions
|
|
@ -68,7 +68,7 @@ class PasswordNavigationDataSource: NSObject, UITableViewDataSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
filteredSections = sections.map { section in
|
filteredSections = sections.map { section in
|
||||||
let entries = section.entries.filter { $0.match(text) }
|
let entries = section.entries.filter { $0.matches(text) }
|
||||||
return Section(title: section.title, entries: entries)
|
return Section(title: section.title, entries: entries)
|
||||||
}
|
}
|
||||||
.filter { !$0.entries.isEmpty }
|
.filter { !$0.entries.isEmpty }
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class CredentialProviderViewController: ASCredentialProviderViewController {
|
||||||
credentialProvider.identifier = serviceIdentifiers.first
|
credentialProvider.identifier = serviceIdentifiers.first
|
||||||
let url = serviceIdentifiers.first.flatMap { URL(string: $0.identifier) }
|
let url = serviceIdentifiers.first.flatMap { URL(string: $0.identifier) }
|
||||||
passwordsViewController.navigationItem.prompt = url?.host
|
passwordsViewController.navigationItem.prompt = url?.host
|
||||||
passwordsViewController.showPasswordsWithSuggstion(matching: url?.host ?? "")
|
passwordsViewController.showPasswordsWithSuggestion(matching: url?.host ?? "")
|
||||||
}
|
}
|
||||||
|
|
||||||
override func provideCredentialWithoutUserInteraction(for credentialIdentity: ASPasswordCredentialIdentity) {
|
override func provideCredentialWithoutUserInteraction(for credentialIdentity: ASPasswordCredentialIdentity) {
|
||||||
|
|
@ -57,7 +57,7 @@ class CredentialProviderViewController: ASCredentialProviderViewController {
|
||||||
}
|
}
|
||||||
credentialProvider.identifier = credentialIdentity.serviceIdentifier
|
credentialProvider.identifier = credentialIdentity.serviceIdentifier
|
||||||
passwordsViewController.navigationItem.prompt = identifier
|
passwordsViewController.navigationItem.prompt = identifier
|
||||||
passwordsViewController.showPasswordsWithSuggstion(matching: identifier)
|
passwordsViewController.showPasswordsWithSuggestion(matching: identifier)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc
|
@objc
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ class PasswordsViewController: UIViewController {
|
||||||
tableView.dataSource = dataSource
|
tableView.dataSource = dataSource
|
||||||
}
|
}
|
||||||
|
|
||||||
func showPasswordsWithSuggstion(matching text: String) {
|
func showPasswordsWithSuggestion(matching text: String) {
|
||||||
dataSource.showTableEntriesWithSuggestion(matching: text)
|
dataSource.showTableEntriesWithSuggestion(matching: text)
|
||||||
tableView.reloadData()
|
tableView.reloadData()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ class PasswordsTableDataSource: NSObject, UITableViewDataSource {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
filteredPasswordsTableEntries = passwordTableEntries.filter { $0.match(text) }
|
filteredPasswordsTableEntries = passwordTableEntries.filter { $0.matches(text) }
|
||||||
showSuggestion = false
|
showSuggestion = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,7 +73,7 @@ class PasswordsTableDataSource: NSObject, UITableViewDataSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
for entry in passwordTableEntries {
|
for entry in passwordTableEntries {
|
||||||
if entry.match(text) {
|
if entry.matches(text) {
|
||||||
suggestedPasswordsTableEntries.append(entry)
|
suggestedPasswordsTableEntries.append(entry)
|
||||||
} else {
|
} else {
|
||||||
otherPasswordsTableEntries.append(entry)
|
otherPasswordsTableEntries.append(entry)
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ class ExtensionViewController: UIViewController {
|
||||||
|
|
||||||
func completeTask(_ text: String?) {
|
func completeTask(_ text: String?) {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.passwordsViewController.showPasswordsWithSuggstion(matching: text ?? "")
|
self.passwordsViewController.showPasswordsWithSuggestion(matching: text ?? "")
|
||||||
self.passwordsViewController.navigationItem.prompt = text
|
self.passwordsViewController.navigationItem.prompt = text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ public class PasswordTableEntry: NSObject {
|
||||||
self.categoryText = entity.getCategoryText()
|
self.categoryText = entity.getCategoryText()
|
||||||
}
|
}
|
||||||
|
|
||||||
public func match(_ searchText: String) -> Bool {
|
public func matches(_ searchText: String) -> Bool {
|
||||||
PasswordTableEntry.match(nameWithCategory: passwordEntity.nameWithCategory, searchText: searchText)
|
PasswordTableEntry.match(nameWithCategory: passwordEntity.nameWithCategory, searchText: searchText)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue