Use Xcode project and Package.swift together?

First, to your overall situation:

As long as BitcoinKit’s own package support is broken, there is no means of using it from SwiftPM.

The feature you would need to work around it as a client is support for binary dependencies. The most up‐to date thread on the subject seems to be this one:

The other thread you already linked from StackOverflow is older, but also still relevant.

I don’t know how broken it is, but you may also be able to fix BitcoinKit’s package support for them, or at the very least fork it and get enough of it working so you can depend on your fork instead.

I'm developing a Swift library/SDK, and up until now, I've been using Carthage for dependencies. But since SPM finally works with iOS, I feel it would be great for people who want to use this library to be able to include it via SPM.

I understand that to mean that you still want clients to be able to continue depending on your library with Carthage according to their preference. In that case, you likely need to manage the two side‐by‐side and independent of one another. (If you wrangle one of your dependencies out of one package manager and embed it into your package for use with the other, you run the risk of a client attempting to use both your package and the same dependency in their dependency graph, in which case they would end up with duplicate modules.)

However, if your package does not need to worry about any clients of its own, then it doesn’t matter.

Second, to your specific question:

There are two methods.

  1. Use Xcode 11’s new package support. The clearest instructions seem to be in this thread:
  1. Use swift package generate-xcodeproj. Then include that project in an Xcode workspace alongside another Xcode project that contains the Xcode‐only stuff.

At the moment there are corner cases with discrepancies between how the two strategies behave. It is possible (though unlikely) that only one or the other of the two methods will work for your specific package (until the related bugs are fixed).

Carthage may have (or be working on) its own solution for integrating SwiftPM packages. It might be worth asking in that community too.