Can I use loadUnaligned on macOS 12?

With the release of Xcode 14, I assumed I would be able to use the new features in Swift 5.7. And indeed, I can use if let shorthand shadowing. But when I try to use UnsafeRawBufferPointer.loadUnaligned, which is shown in the docs as being supported on macOS 10.10+, I'm told "Value of type 'UnsafeRawBufferPointer' has no member 'loadUnaligned'".
I'm on macOS 12.6, Xcode 14.0, and I even tried setting my deployment target to 12.6.

Using loadUnaligned still needs a new macOS SDK, the new version of which wasn't released with Xcode 14. Once a final macOS Ventura SDK is available, though, you will be able to use loadUnaligned in programs and have it back-deploy to older macOS versions.

3 Likes

Thanks, that's good to hear!
It's just a bit confusing in the interim when the function is shown in the Xcode 14.0 docs but it's not actually available.