In Xcode 12.5 with iOS deployment target 14.5 I want to import the swift-collections
library to use module OrderedDictionary
.
When I add the following URL https://developer.apple.com/swift/packages/collections/apple.json
as a package repository I get the following error:
I assume this is an authorisation issue. Where should I enter my credentials?
Package Collections is introduce in Swift 5.5 with Xcode 13.
From Swift.org
You can add it using the new package-collection add option from the SwiftPM command line
$ swift package-collection add https://developer.apple.com/swift/packages/collections/apple.json
After firing the above command, select your project in the Xcode project navigator, select it again in the projects and targets list, and switch to the Swift Packages tab and click the + button below the Packages list, and you'll see a collections list. And add swift-collections package from the list.
Note: Ensure you have at least Swift 5.5 installed. You can check which version of Swift you're running with swift --version
.
Valid URL is: https://github.com/apple/swift-collections
You have to add swift collections package instead of json.
Check Using Swift Collections in your project
section from here
After installing you will get the following tab for selection target. And select OrderedCollections target.
Documentation : https://github.com/apple/swift-collections/blob/main/Documentation/OrderedDictionary.md
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With