Setup for View Controller Tests
Setup for View Controller Tests avatar

To perform full unit testing of a view controller in Swift the definitions and settings in the storyboard need to be loaded. Each view controller class CONTROLLER is connected to a view controller in the storyboard identified by a unique IDENTIFIER. This relationship can be used to instantiate the view controller from the storyboard with all necessary data. Just insert the folloing code at the top of your XCTestCase class.