1.配置:
(1)Build Setting / Packaging / Defines Module 设置为Yes:

(2)Build Setting / Packaging / Product Module Name 设置为工程名:

2.OC文件中插入Swift头文件:
#import "RAZStudent-Swift.h"
3.编译一下,如果不报错,那么就能在OC文件中调用Swift文件代码了,只不过调用的时候需要遵循OC的语法:
[[EyeProtectionModeTool share] setEyeProtectionModeWithIsOn:false];
网友评论