Xcode 14.3 deprecating QuartzCore APIs in a weird way

310 Views Asked by At

Apple deprecated some of the APIs for macOS screen capturing starting from Xcode 14.3. For example: CGDisplayStream.showCursor is marked as deprecated in macOS 13.0-13.3:

enter image description here

However, when I check that in Xcode 14.3, I see that this property was introduced in macOS 13:

enter image description here How am I supposed to ubserstand this? It was not introduced in 13.0. I was using it since macOS 10. If you check the same property in Xcode 14.2:

enter image description here

Same applies to CGDisplayStream.init and others. Has anybody any ideas about this?

2

There are 2 best solutions below

0
Trident On

I also ran into this issue today after upgrading Xcode to 14.3, looks like Apple has found a new way to convey that these constants are going to be deprecated very soon and better to move to ScreenCaptureKit framework or find alternatives.

The only work around I found to this problem is to convert these Swift implementations to Objective C and compile the code using Xcode 14.3, or build the binaries with old Xcode 14.2. When you convert the implementations to Objective C and compile with Xcode 14.3 it would still give you warnings but the code works just fine.

Not sure you are going to like this approach but thought to share.

0
Ross Stepaniak On

That seems to be fixed in Xcode 15. Now the deprecation annotation contains correct macOS version.