title: IOS: Unit testing using dispatch_async is not executing
body: <p>I have written a script similar to below code. I kept breakpoint inside the "dispatch_async", but it is not getting executed. What could be the issue here?</p>
  
  <pre><code> dispatch_async(dispatch_get_main_queue()) {
  
      let array = response!.allObjects as! [NSArray]    
     XCTAssertNotEqual(array.count, 0, testPassed);
     self.waitForExpectationsWithTimeout(10, handler: { (error: NSError?) -&gt; Void in
         if(error != nil) {
            XCTFail("Failed with error: \(error)
        }
       })
  
  
   }
  </code></pre>