在swift中引用OC类
除了加入相应的文件之外,需要添加一个bridging-header。应该命名为“项目名称-Bridging-Header.h“。
一般来说,就是写上#import "类名.h"
然后需要在build-settings里面最好将左边三个targets的objective-c bridging header后面填上该bridging-header的文件路径。

这样没有错误的话,应该就能编译通过了。
在swift中引用OC类
除了加入相应的文件之外,需要添加一个bridging-header。应该命名为“项目名称-Bridging-Header.h“。
一般来说,就是写上#import "类名.h"
然后需要在build-settings里面最好将左边三个targets的objective-c bridging header后面填上该bridging-header的文件路径。
这样没有错误的话,应该就能编译通过了。
本文标题:swift项目引用OC类添加bridging-header操作
本文链接:https://www.haomeiwen.com/subject/choxrttx.html
网友评论