I'm learning RxAlamofire and I faced following issue: in this snippet fragment of code from onNext, onError and onCompleted doesn't get invoked, as if the subscription wasn't working at all. To compare, piece of code with normal Alamofire works just fine.
private func test() {
let disposeBag = DisposeBag()
Observable.from(["1", "2", "3"])
.subscribe(onNext: {
print("\($0) lol")
})
.disposed(by: disposeBag)
let observable: Observable<(HTTPURLResponse,Any)> =
RxAlamofire.requestJSON(.get, "https://api.fixer.io/latest?base=EUR&symbols=USD")
.debug()
observable
.subscribe(
onNext: { [weak self] (r, json) in
print(json)
}, onError: {
print($0)
})
.addDisposableTo(disposeBag)
Alamofire.request("https://api.fixer.io/latest?base=EUR&symbols=USD")
.responseJSON {
print($0)
}
}