objective-c - 具有cocoapods obj-c依赖性的swift项目

标签 objective-c swift cocoapods match

我正在制作一个简单的 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/

相关文章:

ios - 分页 ScrollView 上的中心元素

swift - 如何完成完成 block - Swift/Stripe Payments

swift - swift 2.0 NSDateFormatter 中的错误?

ios - `pod install` 之后的空 Pod header 文件夹

ios - 将字符串添加到 uibutton 标题

iphone - 当我输入 <screen capture> 时,具有 3 行的 UITextView 会自动向上滚动

iPhone OpenGL ES 2.0 奇怪的图案在 COLLADA 文件中渲染球体纹理

ios - addChildViewController 给出 NSException 错误?

ios - Watchkit 扩展中的 SwiftyJSON 不起作用

ios - 如何以编程方式设置 CFBundleVersion(和/或)CFBundleShortVersionString?