OC与Swift混编,对swift单元测试常见error
2021-01-13 本文已影响0人
智能老树皮
1、error "ProjectName-Swift.h" file not found
在单测的target中,Header Search Paths中添加
"$(TARGET_TEMP_DIR)/../$(PROJECT_NAME).build/DerivedSources"
2、bridging header warning
Implicit import of bridging header 'ProjectName-Bridging-Header.h' via module 'ProjectName' is deprecated and will be removed in a later version of Swift
在ProjectNameTests-Bridging-Header.h中引入#import "ProjectName-Bridging-Header.h"即可
3、error Cannot find 'ClassName' in scope
当前测试用例中使用,@testable import ProjectName