EDIT: I apologize all of you, this was all the time my fault - it wasn't possible even in Swift 3. I confused myself big time. Sorry for this question.
Apparently bridging array of enum values to Objective C is no longer possible in Swift 4, not even using @objc annotation:
@objc open func removeCacheAfterDelay(_ delay: Double, forType types: [CacheManagerType]) {
}
@objc public enum CacheManagerType: Int, RawRepresentable {
case credit
case debit
case transactionHistory
}
Following error is displayed at the removeCacheAfterDelay function:
Method cannot be marked @objc because the type of the parameter 2 cannot be represented in Objective-C
Am I missing something? Is there any workaround?
[Int]arrays and map the enums to their raw values. That works because the Ints are mapped to NSNumber, which is an object. - matt