ios 导入我的自定义模块/框架 Xcode Swift

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34099841/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 08:20:32  来源:igfitidea点击:

Import my custom module/framework Xcode Swift

iosxcodeswiftmoduleframeworks

提问by Asdrubal

I want to import my custom module/framework in my Swift project on Xcode 7. I understand how to normally do it. But I don't want to keep dragging and dropping my framework and linking it every time I make a new project. I was thinking I could move the framework to folders in the iPhoneOS.sdk/../Frameworks folder and/or the iPhoneSimulator.sdk/../Frameworks folder. Without dragging or dropping my custom framework into the project, I can import module (with autocomplete). However I get an error "Could not build Objective-C module 'Tumblr'". Is there a Setting in Build Settings I am missing.

我想在 Xcode 7 上的 Swift 项目中导入我的自定义模块/框架。我了解通常如何执行此操作。但是我不想每次创建新项目时都一直拖放我的框架并链接它。我想我可以将框架移动到 iPhoneOS.sdk/../Frameworks 文件夹和/或 iPhoneSimulator.sdk/../Frameworks 文件夹中的文件夹。无需将我的自定义框架拖放到项目中,我就可以导入模块(带有自动完成功能)。但是我收到一个错误“无法构建 Objective-C 模块‘Tumblr’”。构建设置中是否有我缺少的设置。

enter image description here

在此处输入图片说明

**The Tumblr module is a module I created.

**Tumblr 模块是我创建的模块。

I have also created a .tbd and module.map files for the framework existing in the iPhoneOS.sdk

我还为 iPhoneOS.sdk 中存在的框架创建了一个 .tbd 和 module.map 文件

回答by Ajwhiteway

Drag your module's x-code project into the left pane with all the files.

将模块的 x-code 项目与所有文件一起拖到左窗格中。

Then click on your main project file and go to general, scroll down to Embedded Binaries and add it through the menu there.

然后单击您的主项目文件并转到常规,向下滚动到嵌入式二进制文件并通过那里的菜单添加它。

enter image description here

在此处输入图片说明