Adding the table view for the to-do items
As always, we start with a test. But before we can write the test, we need a new test class. Follow these steps to add a test class for the view controller that shows the to-do items:
- Select the ToDoTests group in the Project navigator and add a new file from the File menu in Xcode. Select the template from iOS | Source | Unit Test Case Class and then click Next. Insert the name
ToDoItemsListViewControllerTests
. - In the created file, add
@testable import ToDo
and remove the two template test methods. - Add a property for the system under test (
sut
):// ToDoItemsListViewControllerTests.swift class ToDoItemsListViewControllerTests: XCTestCase { var sut: ToDoItemsListViewController! override func setUpWithError() throws { // Put setup code here. This ... } override func tearDownWithError() throws { // Put teardown code here. This ...