Getting started in Xcode
Now, let's start our journey by creating a project that we will implement using TDD. Proceed as follows:
- Open Xcode and create a new iOS project using the App template.
- In the Options window, add
ToDo
as the product name, select theStoryboard
interface andSwift
as the language, and check the box next to Include Tests. Let the Use Core Data box stay unchecked.
Xcode creates a small iOS project with three targets: one for the implementation code, one for the unit, and one for the UI tests. The template contains code that presents a single view on the screen.
- To take a look at how the app target and test target fit together, select the project in the project navigator and then select the
ToDoTests
target. In the General tab, you'll find a setting for the Host Application that the test target should be able to test. It looks like this:
Xcode...