13b2 ignoring CF_RETURNS_NOT_RETAINED?

I just downloaded and tried Xcode 13b2 on our iOS project. I've been using b1 with a surprising amount of success, switching to 12.5.1 for builds.

But now 13b2 seems to have an issue. In our AVCapture code, you get handed an AVCapturePhoto, and it has methods that return CF_RETURNS_NOT_RETAINED/Unmanaged. If you try to .takeUnretainedValue() on these, the compiler complains that CGImage has no such method. It appears to be ignoring the Obj-C directive.

I'm also unable to view the generated Swift file for that Obj-C header. I get "Couldn't generate Swift Representation" "Error (from SourceKit): Could not load the stdlib module".

Anyone else run into this? I filed FB9211460 about it.

The iOS 15 release notes seem to indicate takeUnretainedValue shouldn't be necessary here anymore:

  • cgImageRepresentation() and previewCGImageRepresentation() now return CGImage? instead of Unmanaged? in Swift. (44734827)
13b2 ignoring CF_RETURNS_NOT_RETAINED?
 
 
Q