Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```swift
- func testConcurrentAsyncOperation() {
- let exp = expectation(description: "\(#function)\(#line)")
- // Create the main operation
- let main = ConcurrentAsyncOperation()
- // The main completion block is executed after the operation has completed.
- main.completionBlock = {
- // Check if the data is received from the dependent operation
- print("The completion block is called.")
- main.completionBlock = nil
- exp.fulfill()
- }
- main.start()
- waitForExpectations(timeout: 40, handler: nil)
- }
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement