Created
January 19, 2018 01:15
-
-
Save fabiothiroki/9b8d78cc079e5ed0e740376d132cb610 to your computer and use it in GitHub Desktop.
Places Service Inicial Implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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