-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for UIToolbar changes
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## UIToolbar | ||
|
||
Unit testing the behavior of items on `UIToolbar`s through UIKit is ordinarily a challenge because of how | ||
difficult accessing the toolbar items directly can be. | ||
|
||
Fleet aims to erase this pain by providing a way to "tap" on tooltip items in-test to fire their associated handlers. | ||
|
||
Suppose you have a `UIToolbar` set up on a page in your storyboard. With Fleet, you can unit test the behavior of | ||
tapping that toolbar's items much more easily than before. With one simple line of code, an item's handler can be fired: | ||
```swift | ||
// Suppose we have items in a toolbar associated with `navigationController` | ||
let toolbar = navigationController.toolbar! | ||
toolbar.tapItem(withTitle: "Some Item") | ||
|
||
// Now you can make any assertions you'd like on the behavior of tapping that item. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters