There has been an introduction of a translate Feature/Framework in the Keynote, but I could not find anything in the Developer App. Any hints?
Post
Replies
Boosts
Views
Activity
I search places with the MKLocalSearchCompleter and refine the results when the tableView cell is selected. When a MKLocalSearchCompletion is selected and MKLocalSearch.Request() is started, I get these Errors (example selects Los Angeles):
According to my research this is a very rare problem?! [SearchAttribution] No matching attribution source found for org.volunteermatch ... (+4 other domains)
Error loading attribution info for identifier org.volunteermatch from geod: Error Domain=GEOErrorDomain Code=-8 "No matching attribution source found for org.volunteermatch" UserInfo={NSDebugDescription=No matching attribution source found for org.volunteermatch} ... (+4 other domains)
These are the instance variables in a TableViewController:
var searchCompleter = MKLocalSearchCompleter()
var searchResults = [MKLocalSearchCompletion]()
This code is running everytime the search term is changed:
searchCompleter.queryFragment = text
searchCompleter.resultTypes = .address
searchCompleter.region = region
In tableView … didSelectRowAt… this code is executed:
let selectedItem = searchResults[indexPath.row]
let searchRequest = MKLocalSearch.Request()
searchRequest.naturalLanguageQuery = selectedItem.title
searchRequest.resultTypes = .address
let search = MKLocalSearch(request: searchRequest)
search.start { (response, error) in
guard let coordinate = response?.mapItems[0].placemark.coordinate else {
return
}
// send to mainVC
self.delegate?.userSelectedPlace(coordinate: coordinate)
}