How to use swift files in objective c

可紊 提交于 2020-01-14 09:07:08

问题


I want to use my Swift files in Objective-C code. I found different link that say how to do it.

My project name is: Test-Project.

I imported #import "Test-Project-Swift.h" to my .m file to use needed classed in objective c source code.

I watched this video and there is no problem, but I have 'Test-Project-Swift.h' file not found.


回答1:


As we recognized: It looks like the problem with "-" we need to change it to "_" - "Test_Project-Swift.h". I've checked Objective-C Generated Interface Header Name in the project settings.



来源:https://stackoverflow.com/questions/38636257/how-to-use-swift-files-in-objective-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!