0
Iは以下のコードをコンパイルしようとすると、私はエラーを取得:RxAlamofire:メンバーにあいまい参照 'JSON(_:_:パラメータ:符号:ヘッダー:)'
Ambiguous reference to member 'json(::parameters:encoding:headers:)'
コードがコピーされたとRxAlamofireのために、あなたはjson(::parameters:encoding:headers:)
を使用し、代わりに、URLSession RX拡張子を使用する必要はありませんが、エラーを修正するにはRxAlamofireのGithubリポジトリのページ
import RxSwift
import RxAlamofire
class CurrencyRest {
static func getJson() {
let stringURL = "https://api.fixer.io/latest"
// MARK: NSURLSession simple and fast
let session = URLSession.init()
_ = session.rx.json(.get, stringURL)
.observeOn(MainScheduler.instance)
.subscribe { print($0) }
}
}