Closed AndrexOfficial closed 4 years ago
There used to be an extension:
extension AVMetadataMachineReadableCodeObject {
@available(swift 4.0)
@available(iOS 7.0, *)
@nonobjc public var corners: [CGPoint] { get }
}
I don't' know why they are gone in Xcode 12 Beta 6. How about filing a FB to Apple?
I didn't find anything related on the release notes page (https://developer.apple.com/documentation/xcode-release-notes/xcode-12-beta-release-notes/), so maybe comment this line out for now (you won't see the corners drawn on the reader view).
Still a problem in GM 😬
Looks like someone has already filed, plus seems more properties have issues too: https://developer.apple.com/forums/thread/658471
Apple documentations suggests this hasn't been removed: https://developer.apple.com/documentation/avfoundation/avmetadatamachinereadablecodeobject/2926566-corners
Someone interestingly said:
This happened before and is related to how obj-c symbols are imported in Swift, not deprecation/removal of API. corners at least exists in the non-simulator SDK, so you can perhaps work-around using #if !targetEnvironment(simulator).
This means, as the bug appears to only affect the simulator, the following code can be used to fix the error until the issue is resolved.
#if !targetEnvironment(simulator)
cornersArray.append(barcodeObject.corners)
#endif
🎉 Congrats
🚀 RSBarcodes_Swift (5.1.0) successfully published 📅 September 17th, 20:01 🌎 https://cocoapods.org/pods/RSBarcodes_Swift 👍 Tell your friends!
I was tying to build my project where I use RSBarcodes but I get a compiler error saying that: Value of type 'AVMetadataMachineReadableCodeObject' has no member 'corners'
It occurs on RSCodeReaderViewController.swift at line 401.
How can I fix it?