Search code examples
swiftxcodeswift-package-manager

How to correctly add local Swift Package to Xcode 15 project to see and use its content?


I would like to create my first Swift Package to reuse code in different projects. Creating the Package was no problem. However, when adding as dependency to another project, I can neither see nor use the package content.

The package: Package config Dummy class in Package

Package in project: enter image description here enter image description here

As one can seen in the 3rd image, the package seems to be added correctly. Just as some other third-party package. However, while one can extend the third-party package within the project navigator and see its content, MyPackage cannot be extended and thus does not show any content. It is also not possible to import MyPackage or use its classes.

What am I doing wrong here?


Solution

  • You can only have the package open on 1 Xcode Window/Project at a time.

    Close all Xcode windows then open the project.

    You can edit the package from the project.