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:
However, when I check that in xCode 14.3, I see that this property was introduced in macOS 13:
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:
Same applies to CGDisplayStream.init
and others. Has anybody any ideas about this?
2
Answers
That seems to be fixed in xCode 15. Now the deprecation annotation contains correct macOS version.
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 toObjective C
and compile the code usingXcode 14.3
, or build the binaries with oldXcode 14.2
. When you convert the implementations toObjective C
and compile withXcode 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.