O'Reilly logo

Test-Driven iOS Development with Swift 4 - Third Edition by Dr. Dominik Hauser

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Code coverage in Xcode

Xcode has added native support for the measurement of the code coverage of tests with version 7. To enable it, select Edit Scheme... in the scheme selector in Xcode:

In the following pop-up window, select the Test phase and check Gather coverage data:

That is all! If you have tried to add the gathering of code coverage in Xcode 6, you will most probably be impressed by how easy this is in Xcode 9. Close the window, and run all the tests to measure the code coverage.

After the tests have finished, select the Report Navigator, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required