Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 639
DerrickHo328 Avatar asked Dec 13 '22 22:12

DerrickHo328


1 Answers

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

$(PLATFORM_DIR)/Developer/Library/Frameworks
like image 142
Bartosz Janda Avatar answered Jan 14 '23 19:01

Bartosz Janda