Skip to content

Commit

Permalink
Call request count update on main thread
Browse files Browse the repository at this point in the history
  • Loading branch information
mkj-is committed Sep 24, 2018
1 parent b1e33a0 commit bf07ad9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/APIAdapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ public final class URLSessionAPIAdapter: APIAdapter {

private var runningRequestCount: UInt = 0 {
didSet {
delegate?.apiAdapter(self, didUpdateRunningRequestCount: runningRequestCount)
guard let delegate = delegate else { return }
DispatchQueue.main.async {
delegate.apiAdapter(self, didUpdateRunningRequestCount: self.runningRequestCount)
}
}
}

Expand Down

0 comments on commit bf07ad9

Please sign in to comment.