In this chapter, we encountered Swift Package Manager and reviewed its main features. Then, we used it to create a package that contains a simple Swift framework, a command-line tool using it, and some unit tests. Swift Package Manager makes it easy to add external dependencies to your packages, whether they are remote or local Git repositories, and we showed how you can add and remove them. The last step in an SPM-based development cycle is generating a convenience Xcode project that will makes it easy for you to use your Swift package in another project.
Often, creating libraries is not an organic process where you start off with the idea for a new library. In fact, it's usually the opposite, and you see the chance to create a library from a monolithic codebase once you find a second use for some piece of code. So, we looked at how you can extract that code from...