0
當我試圖編譯下面的代碼,我得到一個錯誤:RxAlamofire:歧義參考構件「JSON(_:_:參數:編碼:頭:)」
Ambiguous reference to member 'json(::parameters:encoding:headers:)'
的代碼被複制和從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) }
}
}