Skip to content

Instantly share code, notes, and snippets.

@fabiothiroki
Created January 19, 2018 01:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabiothiroki/9b8d78cc079e5ed0e740376d132cb610 to your computer and use it in GitHub Desktop.
Save fabiothiroki/9b8d78cc079e5ed0e740376d132cb610 to your computer and use it in GitHub Desktop.
Places Service Inicial Implementation
struct PlacesService {
private let provider: MoyaProvider<PlacesApi>
init(provider: MoyaProvider<PlacesApi>) {
self.provider = provider
}
func placesAround(latitude: Double, longitude: Double) -> Observable<LocationPlaces> {
return self.provider.rx.request(.recommended(latitude: latitude,
longitude: longitude))
.map(to: LocationPlaces.self, keyPath: "response")
.asObservable()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment