【发布时间】:2019-08-07 07:19:44
【问题描述】:
我有这样的枚举:
public enum TrackingValue {
case constant(String)
case customVariable(name: String)
case defaultVariable(DefaultVariable)
public enum DefaultVariable {
case advertisingId
case advertisingTrackingEnabled
case appVersion
case connectionType
case interfaceOrientation
case isFirstEventAfterAppUpdate
case requestQueueSize
case adClearId
}
}
是否有人对如何在 Objective-C 中提供类似的东西有任何最佳实践建议?
谢谢
【问题讨论】:
-
你是否尝试在'public'标签之前添加@objc标签?
-
Objective-C 中的枚举是 Int 在 Swift 中是对象
-
@Azat 是的,当然,但我得到一个错误 '@objc' enum must declare an integer raw type ,我不知道如何将这种情况转换为在 Objective C 中可用。
标签: objective-c swift enums