@@ -38,8 +38,7 @@ class CredentialProviderViewController: ASCredentialProviderViewController {
38
38
credentialProvider. identifier = serviceIdentifiers. first
39
39
let url = serviceIdentifiers. first. flatMap { URL ( string: $0. identifier) }
40
40
passwordsViewController. navigationItem. prompt = url? . host
41
- let keywords = url? . host? . sanitizedDomain? . components ( separatedBy: " . " ) ?? [ ]
42
- passwordsViewController. showPasswordsWithSuggstion ( keywords)
41
+ passwordsViewController. showPasswordsWithSuggstion ( matching: url? . host ?? " " )
43
42
}
44
43
45
44
override func provideCredentialWithoutUserInteraction( for credentialIdentity: ASPasswordCredentialIdentity ) {
@@ -57,7 +56,7 @@ class CredentialProviderViewController: ASCredentialProviderViewController {
57
56
}
58
57
credentialProvider. identifier = credentialIdentity. serviceIdentifier
59
58
passwordsViewController. navigationItem. prompt = identifier
60
- passwordsViewController. showPasswordsWithSuggstion ( [ identifier] )
59
+ passwordsViewController. showPasswordsWithSuggstion ( matching : identifier)
61
60
}
62
61
}
63
62
@@ -68,14 +67,3 @@ extension CredentialProviderViewController: PasswordSelectionDelegate {
68
67
credentialProvider. persistAndProvideCredentials ( with: passwordEntity. getPath ( ) )
69
68
}
70
69
}
71
-
72
- private extension String {
73
- var sanitizedDomain : String ? {
74
- replacingOccurrences ( of: " .com " , with: " " )
75
- . replacingOccurrences ( of: " .org " , with: " " )
76
- . replacingOccurrences ( of: " .edu " , with: " " )
77
- . replacingOccurrences ( of: " .net " , with: " " )
78
- . replacingOccurrences ( of: " .gov " , with: " " )
79
- . replacingOccurrences ( of: " www. " , with: " " )
80
- }
81
- }
0 commit comments