Swift Playgrounds supports two kinds of projects: playgrounds and app playgrounds. This article explains how to add a package dependency to an app playground. Is there a way to add package dependencies to a regular (non-app) playground?
More generally, I’m looking for a simpler way to run a Swift script that depends on an external package I’ve written than:
swift package init --type executable
- Manually adding the necessary lines to
Because I’m teaching Swift to novice programmers, and I fear that the above would be too many hoops. Swift Playgrounds would be a good pedagogical fit, but I’m open to alternative solutions.
Have you tried Arena?
Hadn’t heard of it; thanks for the tip! It does look like Arena will solve the problem. I’ll check it out.