Swift框架集成

编程入门 行业动态 更新时间:2024-10-28 12:18:28
Swift框架集成 - Xcode显示错误但编译正常(Swift framework integration - Xcode shows errors but compiles ok)

我创建了一个Swift框架,并使用Carthage将该框架集成到了我的项目中。 Carthage github页面上提到的所有必要步骤均已完成。

当我在我的主项目代码中使用框架类时,Xcode会在编辑器(边缘处的红色惊叹号)中引发任何框架类型的错误 - 使用未声明类型....但是,项目本身编译得很好,并且与框架功能。 另一个相关问题可能是我没有得到任何关于我的框架代码的自动完成建议。 框架类,结构等被标记为必要的。

我在这里错过了什么步骤 - 我需要做什么以便Xcode不显示这些错误?

框架代码使用Swift 2.3编写在Xcode 8上,主要项目使用Swift 2.3在Xcode 7.3.1上管理

I have created a Swift framework and I have integrated that framework into my project using Carthage. All the necessary steps mentioned on the Carthage github page have been completed.

When I use the framework classes in my main project code, Xcode throws up errors in the editor (red exclamations in the margin) for any framework type - Use of undeclared type .... However the project itself compiles fine and works perfectly with the framework functionality. Another related issue might be that I do not get any autocomplete suggestions for my framework code. The framework classes, structs etc have been marked public as necessary.

What step am I missing here - what do I need to do so that Xcode does not show those errors?

The framework code is written on Xcode 8 with Swift 2.3, the main project is being managed on Xcode 7.3.1 with Swift 2.3

最满意答案

Xcode 7.3.1仅支持Swift 2.2。 请将您的项目升级到Xcode 8中的Swift 2.3

Xcode 7.3.1 supported only till Swift 2.2. Please upgrade your project to Swift 2.3 in Xcode 8

更多推荐

本文发布于:2023-07-22 02:16:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1216033.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:框架   Swift

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!