iOS Unit Testing: Class is implemented in both

前端 未结 4 1567
甜味超标
甜味超标 2020-12-19 08:38

I\'m building an iOS 9 App with Swift 2 and Xcode 7.

My app runs fine when deploying it to my phone but when I run any unit test, I get the following error message f

4条回答
  •  半阙折子戏
    2020-12-19 09:16

    Only add the test class to your test target and none of the iPhone app classes. Then simply import your app name as a module on top of your test class to get access to all app classes.

    import MyAppName
    

提交回复
热议问题