skip to Main Content

Apple deprecated some of the APIs for macos screen capturing starting from xCode14.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 mac os 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

Answers


  1. Chosen as BEST ANSWER

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


  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search