Recall & Review
beginner
What is the main purpose of the Swift Package Manager (SPM)?
Swift Package Manager helps you manage and share Swift code by handling dependencies, building, and distributing packages easily.
Click to reveal answer
beginner
Name the default file that defines a Swift package's configuration.
The file is called
Package.swift. It describes the package's name, products, dependencies, and targets.Click to reveal answer
intermediate
What are 'targets' in a Swift package?
Targets are the basic building blocks of a package. Each target can be a module or a test suite, containing source files to compile.
Click to reveal answer
beginner
Where should source files be placed in a Swift package project structure?
Source files go inside the
Sources/ directory, organized by target name. Test files go inside Tests/ similarly.Click to reveal answer
intermediate
How do you add an external dependency to a Swift package?
You add the dependency URL and version in the
dependencies array inside Package.swift. Then you specify which targets use it.Click to reveal answer
Which directory contains the main source code in a Swift package?
✗ Incorrect
The Sources/ directory holds the main source code files for the package.
What file do you edit to define your Swift package's dependencies?
✗ Incorrect
Package.swift is the configuration file where dependencies are declared.
In Swift Package Manager, what is a 'target'?
✗ Incorrect
A target is a set of source files compiled into a module or test suite.
Where do you put test files in a Swift package?
✗ Incorrect
Test files go inside the Tests/ directory, organized by target.
Which command initializes a new Swift package?
✗ Incorrect
The command 'swift package init' creates a new Swift package with the default structure.
Explain the basic folder structure of a Swift package project and the role of each folder.
Think about where your code and tests live and how the package knows about them.
You got /3 concepts.
Describe how you add and use an external dependency in a Swift package.
Focus on editing Package.swift and how targets relate to dependencies.
You got /3 concepts.