DerrickHo328
DerrickHo328

Reputation: 4886

Creating a framework that uses XCTest

I am developing several iOS Apps that require testing. I have created some helper methods that extend the functionality of the classes in XCTest. However because they are separate apps, I end up duplicating code.

If this were a Non-test situation, I would create a framework called Common.framework and put all my class extension in there.

I would like to create a framework called "XCTest_extensions.framework" so that I can add the class extensions I have made for XCTest classes.

My plan is to make XCTest_extensions into a framework that only a UnitTest bundle would import.

However, if I create a framework and add XCTest to "Linked frameworks and libraries" it doesn't work! It says "Framework not found XCTest"

Is it possible to create an a dynamic framework that imports XCTest?

Upvotes: 4

Views: 1450

Answers (1)

Bartosz Janda
Bartosz Janda

Reputation: 1661

You have to add additional Framework Search Path in the Build Settings:

$(PLATFORM_DIR)/Developer/Library/Frameworks

Upvotes: 13

Related Questions