Hi,
In the following code, I filter an array, but it only works with the first letter of the name. For Example, when I write "A" in the TextField, the filter shows me "Apple". But if I write "Ap", the filter shows me nothing. Can you help me?
In the following code, I filter an array, but it only works with the first letter of the name. For Example, when I write "A" in the TextField, the filter shows me "Apple". But if I write "Ap", the filter shows me nothing. Can you help me?
Code Block Swift List{ ForEach(groupedArray.keys.sorted().filter{ text.isEmpty || $0.contains(text) }, id: \.self){key in Section(header: Text(key)) { ForEach(groupedArray[key]!, id: \.self){website in NavigationLink( destination: WebView(website: website, url: URL(string: website.url)), label: { Text(website.name) Spacer() if website.image != ""{ RemoteImage(url: website.image).frame(width: 25, height: 25, alignment: .center) }else{ Loader() } }) } } } }