美文网首页
OC与Swift混编,对swift单元测试常见error

OC与Swift混编,对swift单元测试常见error

作者: 智能老树皮 | 来源:发表于2021-01-13 16:17 被阅读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

相关文章

网友评论

      本文标题:OC与Swift混编,对swift单元测试常见error

      本文链接:https://www.haomeiwen.com/subject/wpluaktx.html