Can't use Swift classes inside Objective-C

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

    Also probably helpful for those of you with a Framework target:

    The import statement of the auto-generated header file looks a bit different from app targets. In addition to the other things mentioned in other answers use

    #import 
    

    instead of

    #import "ProductModuleName-Swift.h"
    

    as per Apples documentation on Mix & Match for framework targets.

提交回复
热议问题