Filling in the data
Follow these steps to update the user interface with the data from the to-do item:
- We start with a new test. Add the following test method to
ToDoItemDetailsViewControllerTests:// TodoItemDetailsViewControllerTests.swift func test_settingToDoItem_shouldUpdateTitleLabel() { let title = "dummy title" let toDoItem = ToDoItem(title: title) sut.toDoItem = toDoItem }
At this point, we get an error from Xcode that Value of type 'ToDoItemDetailsViewController' has no member 'toDoItem'.
- Go to
ToDoItemDetailsViewControllerand add thetoDoItemproperty:// ToDoItemDetailsViewController.swift class ToDoItemDetailsViewController: UIViewController { @IBOutlet var titleLabel: UILabel! @IBOutlet var dateLabel: UILabel! @IBOutlet var locationLabel: UILabel! @IBOutlet var descriptionLabel: UILabel! @IBOutlet var mapView: MKMapView! ...