What is the difference between a Swift package and a module?

Swift has a modular code that can be sorted modulo.

But you can use the Swift package manager to extract and install modules.

Is there a difference between a "Swift package" and a "Swift module"? When should I use one phrase or another?

+4
source share
2 answers

As stated in Swift.org

Modules: Swift organizes code into modules. Each module defines a namespace and provides access control on which portions of this code can be used outside the module.

. , Darwin macOS Glibc Linux, , , .

, , . , , , . , .

: Swift . , Package.swift, PackageDescription.

. .

0

Swift ... , . Swift , Swift.

Swift Swift - Swift - , , Swift , ​​ (public, internal, private) . Swift , , C .

Swift Xcode, Swift Xcode.

https://github.com/apple/example-package-fisheryates Swift ( Package.swift ), URL-, Swift : https://github.com/apple/example-package-fisheryates/tree/master/Sources.

+12

Source: https://habr.com/ru/post/1654616/


All Articles