Skip to content

Instantly share code, notes, and snippets.

@vialyx
Created October 15, 2018 11:12
Show Gist options
  • Save vialyx/ed3288670924f65b1444ec41ffac31ea to your computer and use it in GitHub Desktop.
Save vialyx/ed3288670924f65b1444ec41ffac31ea to your computer and use it in GitHub Desktop.
// enable entities to be used within any source file from their defining module, and also in a source file from another module that imports the defining module.
public var publicVariable = 0
// enables entities to be used within any source file from their defining module, but not in any source file outside of that module.
internal let internalConstant = 1
// access restricts the use of an entity to its own defining source file.
fileprivate var fileprivateVariable = 2
// restricts the use of an entity to the enclosing declaration, and to extensions of that declaration that are in the same file.
private let privateConstant = 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment