fix network service background thread crash
This commit is contained in:
parent
c7e5687f0b
commit
384180443b
|
|
@ -84,7 +84,10 @@ open class NetworkService {
|
|||
|
||||
/// Shows network activity indicator when requests in executed. Works only on iOS.
|
||||
public func bindToApplicationActivityIndicator() {
|
||||
bindActivityIndicator()?.disposed(by: disposeBag)
|
||||
// Fatal error: `drive*` family of methods can be only called from `MainThread`
|
||||
DispatchQueue.main.async {
|
||||
bindActivityIndicator()?.disposed(by: self.disposeBag)
|
||||
}
|
||||
}
|
||||
|
||||
/// Disable showing network activity indicator.
|
||||
|
|
|
|||
Loading…
Reference in New Issue