But when I open my macOS 10.15 targeted package, the function is simply is not recognized by Xcode. As if it did not exist. I have the same problem from the command line:
> swift --version
Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)
Target: x86_64-apple-darwin19.6.0
> swift package --version
Swift Package Manager - Swift 5.3.0
> swift build
...
6:21: error: extraneous argument label 'unsafeUninitializedCapacity:' in call
let cafe1 = String(unsafeUninitializedCapacity: validUTF8.count) {
I get that - but it has nothing to do with my question. What I used was the example in the documentation. Works for my IOS project, not for my macOS project.
I'm new to swift and installed xcode, followed the hello tutorial, and got the same message you did. So, after reading this, I updated to the beta, and I am still getting that error.
What version of MacOS/iOS are developing on? What version of MacOS/iOS are you deploying to? Deployment target has to be MacOS 11.0 (has not been released yet) for macOS, iOS14 for iOS, similar for iPAD OS.