Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alertController 结合 Alamofire会报错 #237

Open
lumangmang opened this issue Sep 26, 2021 · 0 comments
Open

alertController 结合 Alamofire会报错 #237

lumangmang opened this issue Sep 26, 2021 · 0 comments

Comments

@lumangmang
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant