Skip to content

Instantly share code, notes, and snippets.

@fabiothiroki
Created November 11, 2017 18:22
Show Gist options
  • Save fabiothiroki/0d1e0edfb9674407719af8cebe42c81d to your computer and use it in GitHub Desktop.
Save fabiothiroki/0d1e0edfb9674407719af8cebe42c81d to your computer and use it in GitHub Desktop.
Simple RxMoya call
provider: MoyaProvider<PlacesApi> = MoyaProvider<PlacesApi>() // providers should be retained
provider.rx.request(.recommended(latitude: -23.5666151, longitude: -46.6463977))
.map(to: LocationPlaces.self, keyPath: "response")
.subscribe(onSuccess: { (place) in
print(place)
}, onError: { (error) in
print(error)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment