I'm using a class, which is originally written in Swift, that extends NSObject
from a third-party XCFramework:
open class ExampleClass: NSObject, Codable { ... }
Since this is a third-party class, I can't modify the original, so I created an extension on top of it to override isEqual(_ object:)
:
extension ExampleClass {
override open func isEqual(_ object: Any?) -> Bool {
return true
}
}
This is currently compiling and building fine on Xcode 11, but with the same branch on Xcode 12, I'm getting an error that says '@objc' instance method in extension of subclass of 'ExampleClass' requires iOS 13.0.0
I've found a similar issue that seems to imply that functionality can't be overridden in a Swift extension, but I'm trying to understand what's changed since migrating from Xcode 11 to 12. Was there something that changed recently that prevents this from happening? Any thoughts on working around this?