This section offers some very general information on the different ways in which third-party code can be shared.
This is the simplest way to make use of code that somebody else has made available. You just need to get the source code file, import it into your projects, and you're ready to go. Assuming, that is, that the source code doesn't need other third-party code itself, which you'll need to find, and add, if it does.
Libraries are basically collections of source code files. There are no other resources; it's all code, usually with some theme or functionality that binds them together.
You are already using libraries all the time. From your very first line of Swift, you have been using the Swift Standard Library, for example, which defines much of the most basic layer of Swift functionality, including:
- Fundamental data types, such as
Int
andString
- Data structures, such as
Array
andDictionary
- Protocols, such as
Comparable...