Can't use Swift classes inside Objective-C

前端 未结 25 2062
野趣味
野趣味 2020-11-22 08:10

I try to integrate Swift code in my app.My app is written in Objective-C and I added a Swift class. I\'ve done everything described he

25条回答
  •  醉酒成梦
    2020-11-22 08:37

    well, after reading all the comments and trying and reading and trying again, I managed to include swift classes into my Big obj-c project. So, thanks for all the help. I wanted to share one tip that helped me understand the process better. In the .m class, went to the import line of the swift target name #import "myTargetName-Swift.h" and clicked the key:

    command + mouse click -> Jump to definition

    There you can see all the translation from swift to obj-c and ther you will find the various functions re-declared in obj-c. Hope this tip will help you as much as it helped me.

提交回复
热议问题