Reputation: 750
I have enum like this:
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
}
}
Does anyone have any best-practice suggestion on how to make something like this available in Objective-C?
Thanks
Upvotes: 0
Views: 2067
Reputation: 781
You can use only Enums witch can be represented in objc:
Therefore you can only create another enum, witch can be represented in objc and just add method to convert to it:
public enum TrackingValue {
...
func toObjc() -> ObjcEnum {
...
}
}
and create somewhere swift method to another side:
func convert(_ type: ObjcEnum) -> TrackingValue {
...
}
Upvotes: 1