ios - 将框架添加到 Swift 项目

标签 ios swift

我正在尝试使用 SwiftIconFont Framework在我的项目中。我遵循了列出的所有指示。我添加了 pod 'SwiftIconFont', '~> 2.7' 然后执行了 pod install。终端吐出:

Analyzing dependencies
Downloading dependencies
...
...
Installing SwiftIconFont (2.7.0)
...
...
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 8 dependencies from the Podfile and 13 total pods installed.

从这个终端消息来看,SwiftIconFont 应该已经成功安装到我的项目中了。但是,当我转到我的项目尝试链接 SwiftIconFont 框架时,添加的目录似乎是空的。

SwiftIconFont directory is empty

我试图import SwiftIconFont 但Xcode 说不存在这样的模块。我还应该做什么才能使用这个框架?

我还在我的 Cartfile 中添加了 github "0x73/SwiftIconFont",然后执行了 carthage update,尽管这一步可能是不必要的。

最佳答案

我不确定为什么会发生这种情况,但解决问题的一种方法是进入build设置并将框架搜索路径定义到包含相关框架的文件夹。如果框架位于您的项目目录中,只需将框架搜索路径设置为 $(SRCROOT) 并将其设置为递归即可。

关于ios - 将框架添加到 Swift 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45855262/

相关文章:

ios - 丰富的推送通知 - 视频不会在通知内容扩展中播放

ios - UIPopoverController popoverControllerDidDismissPopover 不起作用

ios - "There is no registered handler for URL scheme com-google-gidconsent"使用 GIDSignIn 登录时出错

json - 将 json 响应转换为 Realm 对象

ios - 如果禁用音频/振动 AVPlayer 不发声 : on

iOS Today 扩展崩溃

ios - 使用 NSXMLParser 解析 xml 属性

iphone - 使用actionscript3和Adobe AIR添加gameCenter功能

iphone - iOS 开发 : NSDateFormatter problem

ios - MapView 注释中的较长字幕(快速)