After a lot of pain, I found the 4-month old app version compiles fine. So I did git bisect
and found the offending commit, and then this code:
struct Config: Equatable {
let formatDescription: CMFormatDescription
let orientation: CGImagePropertyOrientation
}
Turns out CMFormatDescription
did become Equatable
only in iOS 13, while the app deployment target is iOS 11. It probably felt back to [NSObject isEqual:]
in Xcode 10, but it became complicated in Xcode 11. Since Swift automatically generates Equatable
conformance under the hood it had troubles in pointing the exact place of the error. The solution is to add your own Equatable
implementation for CMFormatDescription
:
extension CMFormatDescription: Equatable {
public static func == (lhs: CMFormatDescription, rhs: CMFormatDescription) -> Bool {
return CMFormatDescriptionEqual(lhs, otherFormatDescription: rhs)
}
}