Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
deda9 authored Jul 17, 2019
1 parent b1737a7 commit 2ad8d4a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
# WaitUntil

Its a sugar syntax to use expectation to run asynchronous work on XCTestCase.

#### It replaces:
```Swift
let imageLoader = ImageLoader()
let completedExpectation = expectation(description: "Completed")

imageLoader.download { image in
completedExpectation.fulfill()
}

waitForExpectations(timeout: 0.3, handler: nil)

```

#### with:
```Swift
let imageLoader = ImageLoader()

waitUnilt { done in
imageLoader.download { image in
done()
}
}
```

0 comments on commit 2ad8d4a

Please sign in to comment.