Adding a UI test target

First, we need to add a UI test target to our project. In Project Navigator, select the project and click on the button at the bottom of the view showing the target list:

From the template chooser, navigate to iOS | Test | iOS UI Testing Bundle. Let the name remain as Xcode suggests it, click on Next, and then on Finish.

Get Test-Driven iOS Development with Swift 4 - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.