Why can't we use dispatch_sync when doing asynchronous network testing for iOS?

98 views Asked by At

I understand why dispatch_sync would be an issue when dispatched from the main thread when dealing with UI handling, but why is it an issue when running simple XCTests? Why can't the main thread be blocked during these tests? Why do we use semaphores rather than just synchronously dispatching these network events for testing?

Thank you.

0

There are 0 answers