Can't import main swift classes into test target?

后端 未结 4 981
半阙折子戏
半阙折子戏 2020-12-28 17:47

I am trying to test the classes in my iOS app. I am trying to import the target Pickle in my app that has all my classes into my testing target PickleTest

4条回答
  •  隐瞒了意图╮
    2020-12-28 18:22

    Import Module on top of your test class

    @testable import myModuleName
    

    You can find-out your module name on Target->Build Settings-> Product Module Name

    Then you can use any of class which belongs to that module. No need to import classes one by one.

提交回复
热议问题