How to reference Swift enum in Objective-C Header

前端 未结 7 2066
星月不相逢
星月不相逢 2021-01-31 19:38

Is there a way to reference a Swift enum from an Objective-C header? If you want to see Swift classes in the Objective-C header you can use

@objc class Foo
         


        
7条回答
  •  既然无缘
    2021-01-31 19:53

    You can access Swift enums in Objective-C, but only if the enum is declared with an @objc qualifier, which means that it has to be of type Int.

提交回复
热议问题