Can't use Swift classes inside Objective-C

前端 未结 25 2036
野趣味
野趣味 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 08:20

    my problem was I got stuck after xcode created the bridge file but still I got error in header file name MYPROJECTNAME-swift.h

    1.I check in terminal and search for all auto created swift bridge files:

    find ~/library/Developer/Xcode/DerivedData/ -name "*-Swift.h"|xargs basename|sort -

    you see what xcode created.

    1. in my case, I had space in my project name and xcode replace this is '_'

提交回复
热议问题