lundi 4 avril 2016

Swift unit testing and "build for testing" errors

I have a project that build fine until I try to unit test. When I "build for testing" I get several errors. For example these few lines of Swift

@IBOutlet weak var panAndZoomView: SegmentationPanAndZoomView!
@IBOutlet weak var toolbarView: SegmentationToolbarView!

gives two build errors:

Use of undeclared type 'SegmentationPanAndZoomView'

'weak' may only be applied to class and class-bound protocol types, not '<>'

xcode screenshot

I have included

@testable import Thinga_Me

to pull in the Product Module Name (as suggested in Kostapappas Lampros's comment on Swift 2 + Xcode 7: Unit Testing Access Made Easy), and I have the Testing Target Host Application set with its 'Allow testing Host Application APIs' checked. I have also read through the relevant chapters of the Apple documentation Testing with Xcode.

What am I missing to get this app to 'build for testing' given that 'build for running' has no issues?

Aucun commentaire:

Enregistrer un commentaire