Search code examples
swiftxcodeswift-package-managerswift-package

Editing a Package Dependency as a Local Package


Overview

  • I have a project that uses a remote swift package.
  • I would like to edit this package in the same project so that I can refine it based on the usage.

Aim:

  • To do this I am trying to add the same package as a local package so that I can edit it.

Reference:

https://developer.apple.com/documentation/swift_packages/editing_a_package_dependency_as_a_local_package

Problem:

  • When I drag and drop the cloned folder containing Package.swift into the project, I can't see any of the local package source files in the project. (see screenshot)

Xcode Project with Swift Package

I have been breaking my head over it. Any help on this would be much appreciated.

Xcode Version:

  • 13.2 (13C90) (downloaded from the developer portal not the AppStore)

Solution

  • The reason you cannot see the content of the package is that you have it open in another Xcode instance.

    You can only edit a package in one Xcode instance at a time.

    I find closing down Xcode completely, then opening up the particular project that I want to edit the package in solves the problem.