Search code examples
swiftpackage-managersxcode11

Adding Local dependencies in XCode11 using SPM


Is it posible to integrate local dependencies with SPM in xcode 11, File > Swift Packages > Add Package dependency... It only seems to populate and let me select git repos hosted on bitbucket

I am just not sure if I am approaching the issue the correct way, maybe I should be using a Package.swift file instead? I have a lot of experience with Cocoapods but I would like to branch out and try other tools, especially if they are going to be supported in xcode as it seams SPM will be (Im using xcode11 beta 5)


Solution

  • This is the way I did it :

    • Drag and drop your package folder (in my example "DataStructures") from the finder directly into the Frameworks group of your target. You will see that the dropped item take a brown folder color (you can use the arrow to "get into it").
    • Go to your project target page, in the "Framework and Libraries" click the "+" button. Your package should show up in the "Workspace" area as a library.

    enter image description here