Can't use Swift classes inside Objective-C

前端 未结 25 2069
野趣味
野趣味 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:31

    XCode 11.3.1:

    When I want to use an Swift inner class in a objc code, it does not compile for ther error "undefined symbol"(for bother inner class and outer class), I checked the generated "-swift.h" header and both classes are there.

    After trying for hours I convert the inner class to a normal class and it compiles.

    I clean the project, delete the DerivedData folder and it compiles.

提交回复
热议问题