All quizzes
Free quiz · 20 questions in the bank

Swift Package Manager quiz

Test your Swift Package Manager knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.

Question 1/12Score 0

What is the purpose of an `.executableTarget` versus a plain `.target` in Package.swift?

In this round
  1. What is the purpose of an `.executableTarget` versus a plain `.target` in Package.swift?
  2. What does a `.upToNextMajor(from: "2.0.0")` version requirement mean for a dependency?
  3. What does `swift test` do, and how does it relate to `.testTarget` declarations in Package.swift?
  4. What is the purpose of `swift build` at the command line?
  5. What is a local Swift package used for during development, e.g. via "Add Local Package" in Xcode?
  6. What is `swift package init` used for?
  7. What is the effect of declaring `.package(url: "...", branch: "main")` instead of a version requirement?
  8. What is `Package.resolved` and why is it typically committed to source control?
  9. What is the difference between a "product" and a "target" in a Package.swift manifest?
  10. What is Swift Package Manager (SPM)?
  11. What is a binary target (`.binaryTarget`) used for in SPM?
  12. What is a "trait" or conditional compilation approach for platform-specific code across an SPM package's multiple targets?
Gaps to close?
Read the curated Swift Package Manager notes — core concepts, patterns, interview prep.
Swift Package Manager notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web