Pure Programmer
Blue Matrix


Cluster Map

Dependency Management

L1

This page is under construction. Please come back later.

It is often easier to write programs when you don't have to write all the code from scratch. There are a large number of code libraries available, both open source (free) and commercial (paid). Using code libraries written by the community or commercial developers give you a leg up in your coding efforts by making a large library of useful functions and classes available to your program. All we need to do is manage these dependencies and include them in our programs.

Swift organizes code in to packages. All you need to do to use pre-written package is to download the .swiftmodule Swift module file, put it in your project folder and then include it in your program.

An easier way is to use the [[Swift Package Manager (SwiftPM)]] software that comes with Swift to download and install libraries for you. The community maintains a large online library of packages that you can access using SwiftPM.

You will want to download the [[Pure Programmer Swift Utils Module]] which is needed by some examples and project. Simply put the "Utils.swiftmodule" file in the same folder as your program. Then add an import statement to the beginning of your source file:

import Utils
Using Swift Packages

You can also download the [[Pure Programmer Swift Utils Class]] source if you want to build the package yourself.

References