Unable to access fast files in Unit test target in Xcode

Adding fast files to verify the target will work, but this is not the best way to do it. My problem is that I cannot access the Swift file, while Objective-C files are available.

I checked the product module name and installed the configuration file in the same way as the project file for the target. I even deleted the test target and read it, but still encounters "using an undeclared type in the SlideViewController".

Can someone help me solve this problem?

+4
source share
3 answers

unit test.

docs , , :

  • ENABLE_TESTABILITY build YES.
  • @testable import . @testable import MySwiftApp

, SlideViewController ( ) unit test, .

+4

:

@testable import <YOUR_MODULE_NAME>

0

.

1.-

2.-

3.- ( "MyProjectTests" )

4.- " "

5.- " "

6.- , ,

-1
source

Source: https://habr.com/ru/post/1679697/


All Articles