【问题标题】:swift project with cocoapods obj-c dependence带有cocoapods obj-c依赖的swift项目
【发布时间】:2018-03-18 19:59:25
【问题描述】:

我正在制作一个简单的 swift 应用程序,它链接一个 obj-c cocoapod 依赖项 SFRoundProgressCounterView。我的 Podfile 包含 use_frameworks!。安装 pod 并构建项目后,出现 2 个错误:

SFCounterLabel.h:12:9: 'TTTAttributedLabel.h' 文件未找到

无法构建 Objective-C 模块“SFRoundProgressCounterView”

我检查了 SFCounterLabel.h,它是 SFRoundProgressCounterView 导入 TTTAttributedLabel 的一部分:

#import "TTTAttributedLabel.h"

我尝试将 MyProjectName-Bridging-Header.h 与 #import "TTTAttributedLabel.h" 但没有理由。

我的 Cocoapods 版本是 0.39.0。

我应该怎么做才能将 SFRoundProgressCounterView 正确链接到我的 swift 项目?

【问题讨论】:

    标签: objective-c swift cocoapods match


    【解决方案1】:

    看起来SFCounterLabel.hSFRoundProgressCounterView 需要使用支持框架的导入语法。 #import <TTTAttributedLabel/TTTattributedLabel.h>@import TTTAttributedLabel.TTTAttributedLabel;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-05-27
      • 1970-01-01
      • 2021-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多