Modularizing an Xcode 16 project

My preferred way of setting up an app project no longer works in Xcode 16.

I like to have my apps massively modularized - a separate SPM module for every significant feature. I use a project grouped together with a package that contains all the feature modules. The project's app target imports a consolidated AppFeature from the package that is all the logic of the app.

In Xcode 15 and before, I had a process for creating this kind of setup (described below -- unfortunately the forums don't support collapsible sections). Where I used to be able to drag a directory from Finder into the Xcode files navigator (step 6 in my process), it now rejects the drag.

What I'm looking for is a way to have a single window open that has my Swift package and below that a separate folder for each executable target. Creating new modules in the package automatically creates new schemes in Xcode. Executable targets in the project can reference any module in the package. Source control treats the entire thing as one repository.

I've tried all the approaches I can think of to accomplish the same goal, but no luck. The projects I've already built work fine in Xcode 16 -- I just can't make a new one. Unfortunately I can't revert to Xcode 15 for this purpose since it apparently doesn't run on my work machine with macOS 15.

Here's my process that worked great till now:

  1. In Terminal, create the project folder Foo:
$ mkdir Foo
$ cd Foo
  1. Create the package:
$ swift package init
Creating library package: Foo
Creating Package.swift
...
  1. Create a directory for the project:
$ mkdir App
  1. In Xcode, create a new app project called Foo and put it in the App folder
  2. Open the Foo project
  3. Drag the top level Foo directory from Finder into the Xcode project and drop it immediately under the project name
  4. Close the Xcode project
  5. Create a file called Package.swift and place it in the App folder. Edit it to have an empty package content. This ensures Xcode won’t display that folder in the source navigator under the package header.
import PackageDescription

let package = Package(
  name: "",
  products: [],
  dependencies: [],
  targets: []
)
  1. Open the Xcode project. You should have top-level project name* Foo*. Under that will be the package, also named Foo. Then there will be the app target, also named Foo. You can rename the app target folder Foo to something like iOS if you want to have other targets for other platforms like macOS.
Modularizing an Xcode 16 project
 
 
Q