Search code examples
testingswiftxcode6

How to access Swift files from main target in test target


I'm implementing some tests and I need to access the source files from my main target.
Do I need to add all required files in "Compile Sources" ?


Solution

  • Yes you need to add them in "Compile Sources". Alternatively you can select file in "Project Navigator" and change target membership in "Utility -> File Inspector" pane on right side of Xcode window.