A minimal Swift Package template targeting Swift 6.0+ with modern Swift Testing, CI for Linux/macOS/iOS, SPI config, and swift-format.
Tip
The app branch contains an Xcode project template in AppTemplate/ for creating iOS/macOS apps that links against the package in Sources/SPMTemplate/ and has CI to build apps.
Add this package as a dependency, then:
import SPMTemplate
let greeter = SPMTemplate()
print(greeter.greet(name: "World"))- Format code with
make format - Lint with
make lint - Run tests:
swift test
MIT. See LICENSE.
To quickly rename this template to your own package/target names:
- Open
.github/prompts/rename-swift-template.prompt.md. - Provide inputs:
oldName: current module identifier (default:SPMTemplate)newPackageName: your package in kebab-case (e.g.swift-my-library)newTargetName: your primary module in PascalCase (e.g.MyLibrary)
- Run the prompt with your AI assistant.