将Objective-c框架导入Swift框架项目 [英] Import Objective-c framework into Swift framework project

查看:81
本文介绍了将Objective-c框架导入Swift框架项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个框架,现在我需要在其中导入一些Objective-C框架,但我需要导入"Beaconstac.framework",但是由于我们无法在快速的框架项目中添加桥接头,所以我的问题是我在我的项目中使用了这个框架,但是在我尝试过的项目中无法直接访问

I am building a framework in which I need to import some objective-c frameworks for now I need to import "Beaconstac.framework" but as we can not add a bridging header in a swift framework project so my question is how can I use this framework in my project this is not directly accessible in my project I tried

导入Beaconstac

import Beaconstac

但出现错误没有这样的模块"

but its giving error "No Such Module"

还有其他选择吗?

推荐答案

您需要在伞标头中导入Beaconstac框架.也就是说,如果您通常在Obj-C桥接标头中使用#import <Beaconstac/Beaconstac.h>,对于框架,则需要将其放在伞状标头中.

You need to import the Beaconstac framework in your umbrella header. That is, if you'd ordinarily use, e.g., #import <Beaconstac/Beaconstac.h> in an Obj-C bridging header, for a framework you need to put that in the umbrella header.

有关更多信息,请参阅Apple文档中的本章:

See this chapter in Apple's documentation for more info:

https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html#//apple_ref/doc/uid/TP40014216-CH10-ID130

这篇关于将Objective-c框架导入Swift框架项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆