DEV Community

Cover image for How To Add Multiple Modules In The Swift Package Manager
Nandani Sharma for Canopas Software

Posted on

How To Add Multiple Modules In The Swift Package Manager

What is SPM?

Swift Package Manager, is Apple’s tool for easily adding libraries and frameworks to your project. Introduced in 2015, it’s loved for its simplicity.

Compared to CocoaPods, SPM’s integration is straightforward, and it’s widely adopted, supporting many popular libraries. With ongoing improvements, SPM keeps simplifying development.

Its user-friendly interface and strong capabilities make it vital for modern Swift development.

Table of content

  • How to Create a Swift Package
  • How to create Submodules/Libraries in Package
  • How to Add External Dependency in Swift Package
  • How to Manage Dependency with Plugins
  • Conclusion

How to Create a Swift Package

Creating a Swift Package is as easy as starting a new project.

Open Xcode, go to File , select New , then choose Package . This will create your package.

There is preview of Creating a Swift Package

In our exploration of integrating multiple modules into the Swift Package Manager, we've uncovered the essential steps to enhance your development workflow.

If you're eager to dive deeper into the intricacies of adding multiple modules in the Swift Package Manager, along with insightful code snippets and detailed examples, be sure to check out the full article on Canopas Blog.

Follow Canopas for our latest technical blog posts!

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs