【发布时间】:2021-08-04 10:10:49
【问题描述】:
下面是我的代码。我需要多次调用 api 直到有网络信号。
buttonAction.do(onNext: { [weak self] in
self?.activity.startAnimating()
apiManager.callApi()
.do(onNext: { [weak self] in
self?.activity.stopAnimating()
},onError: { [weak self ] error in
if let error = error as? NoNetwork {
self?.activity.stopAnimating(errorInfo:error,presentationStyle:.alert)
// here alert will be appear. On click ok button, need to trigger the API() again
}
})
.subscribe().disposed(by:bag)
【问题讨论】:
标签: rx-swift uiactivityindicatorview reachability