Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CollectiveHealth-gists/0d43eb442ed980d19d9243072e8312ff to your computer and use it in GitHub Desktop.
Save CollectiveHealth-gists/0d43eb442ed980d19d9243072e8312ff to your computer and use it in GitHub Desktop.
MKLocalSearchCompleter Initialize
// Initialize MKLocalSearchCompleter
let requestCompleter = MKLocalSearchCompleter()
// OnDidCompleteRequestProxy
requestCompleter.rx_completerDidUpdateResults
.flatMap(filterSearchLocation) // filter search locations
.subscribe(onNext: { [weak self] (results) in
// Method to handle search completer success
self?.updateLocations(results)
}, onError: { [weak self] error in
// Method to handle search completer error
self?.handleError(error)
}).addDisposableTo(disposeBag)
// Set request completer query fragment
requestCompleter.queryFragment = queryFragment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment