VStack {
TextField("Enter a location", text: $addressText)
.textInputSuggestions {
ForEach(suggestedVenues.filter { $0.name.lowercased().contains(addressText.lowercased()) || $0.address.lowercased().contains(addressText.lowercased()) }, id: \.id) { venue in
Label(venue.name, systemImage: venue.image)
.textInputCompletion(venue.address)
}
}
.textFieldStyle(RoundedBorderTextFieldStyle())
.padding()
Spacer()
}
.padding()
}
not working in IOS 18.2 ?? 'textInputSuggestions' is unavailable in iOS
The documentation for textInputSuggestions and also textInputCompletion show that they are available starting with macOS 15, and not available on iOS.
— Ed Ford, DTS Engineer