Load a Storyboard-Based View Controller
We added a second view controller because storyboards usually have more than one of them. How can we access an arbitrary view controller within a storyboard? We’ll do this by assigning a Storyboard ID to the view controller we want.
Create a new test suite named StoryboardBasedViewControllerTests. (Remember to start with Test Zero to confirm that the new suite is hooked up.) Add this import declaration at the top of the file:
| @testable import LoadViewControllers |
Then add the following test case:
| func test_loading() { |
Get iOS Unit Testing by Example now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.