Since Swift 1.2 it's been possible to automatically convert enums in Swift to Objective-C. However, as far as I can tell, it is not possible to convert an array of enums. Is this true?
So, this is possible:
@objc public enum SomeEnumType: Int {
case OneCase
case AnotherCase
}
But this is not:
public func someFunc(someArrayOfEnums: Array<SomeEnumType>) -> Bool {
return true
}
Can anyone verify this? And how would you recommend working around this? One approach would be to have two method declarations e.g:
// This will not automatically get bridged.
public func someFunc(someArrayOfEnums: Array<SomeEnumType>) -> Bool {
return true
}
// This will automatically get bridged.
public func someFunc(someArrayOfEnums: Array<Int>) -> Bool {
return true
}
But this is polluting the Swift interface. Any way to hide the second function declaration for any Swift consumers?