Slide 18
Slide 18 text
Alamofire Along With RxSwift
Alamofire Along With RxSwift
func getSprites() -> Observable {
return create{ observer in
var request = Alamofire
.request(.GET, "https://epoquecore.com/sprites",
parameters: nil)
.response({ (request, response, data, error) in
if(error != nil){
sendError(observer, error!);
} else {
sendNext(observer, data);
sendCompleted(observer);
}
});
return AnonymousDisposable {
request.cancel()
}
}
}
Or you can use RxAlamofire
18