-
Notifications
You must be signed in to change notification settings - Fork 150
Description
cell.followButton.rx.action = CocoaAction { [weak self] _ in
return Observable.create { [weak self] observer -> Disposable in
let alertController = UIAlertController(title: "Hello world", message: "This alert was triggered by a button action", preferredStyle: .alert)
var ok = UIAlertAction.Action("OK", style: .default)
ok.rx.action = CocoaAction { [weak self] in
guard let self
= self else { return .empty() }
return self.viewModel.unfollowing(item.outputs.user.id)
.do(onCompleted: {
observer.onCompleted()
})
}
alertController.addAction(ok)
self?.present(alertController, animated: true, completion: nil)
return Disposables.create()
}
}
会报出异常:
didReceive(_:target:): Received networking error: underlying(Alamofire.AFError.explicitlyCancelled, nil)