我正在制作一个简单的 swift 应用程序,它链接一个 obj-c cocoapod 依赖项 SFRoundProgressCounterView。我的 Podfile 包含 use_frameworks!
。安装 pod 并构建项目后,出现 2 个错误:
SFCounterLabel.h:12:9: 'TTTAttributedLabel.h' file not found
Could not build Objective-C module 'SFRoundProgressCounterView'
我检查了作为 SFRoundProgressCounterView 导入 TTTAttributedLabel 的一部分的 SFCounterLabel.h:
#import "TTTAttributedLabel.h"
我尝试将 MyProjectName-Bridging-Header.h 与 #import "TTTAtributedLabel.h" 但没有理由。
我的 Cocoapods 版本是 0.39.0。
我应该怎么做才能将 SFRoundProgressCounterView 正确链接到我的 swift 项目?
最佳答案
看起来像SFCounterLabel.h SFRoundProgressCounterView 需要使用支持框架的导入语法。 #import <TTTAttributedLabel/TTTattributedLabel.h>
或 @import TTTAttributedLabel.TTTAttributedLabel;
关于objective-c - 具有cocoapods obj-c依赖性的swift项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34029718/