I take back my previous answer.
It is possible to add a Playground to a Swift Package.
Open your Swift Package in Xcode, add an iOS/macOS/tvOS Playground, and add your code to the Playground.
Click on the Playground in the Project navigator, and in the File Inspector, make sure you have "Build Active Scheme" checked, then run your Playground. Everything then "Should Just Work".
You can even change the Playground Platform in File Inspector, stop the Playground and rerun, and it should rebuild your Package and rerun your Playground with the new Platform setting.
It may take Xcode a few seconds to figure out that your Package has been built for the target Platform before the "Module 'PackageName' was created for incompatible target" error goes away.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: