1,第一步:
cmd+shift+n新建项目,继承于oc语言.
2,第二步:
build settings--->all---->levels搜索Defines M 找到Defines Module 把2个no改为yes
3,第三步:
建立swift文件
点击creat之后,会弹出如下界面,点击creat Bridging Header
会发现系统自动生成的OcImportSwift-Bridging-Header.h文件
4,第四步
在你用swift的地方引入#import "OcImportSwift-Swift.h"(即你的工程名-Swift.h)就可以使用了.
demo地址:
https://github.com/15737154533/OcImportSwift.git















网友评论