【发布时间】:2016-06-13 23:08:37
【问题描述】:
我有一个 Swift 类,它包含以下 enum:
@objc public enum AlertStyle : Int {
case Success,Error,Warning,None
case CustomImag(imageFile:String)
}
我为在 Objective-C 中使用 swift 类进行了桥接和其他集成阶段,但是当我构建应用程序时,编译器显示以下错误:
<unknown>:0: error: cannot assign value of type '(imageFile: String) -> AlertStyle' to type 'AlertStyle'
我该如何解决?
【问题讨论】:
-
@objc enum不能使用关联值,比较stackoverflow.com/a/30480399/1187415。
标签: ios objective-c swift enums