Access control restricts access to parts of our code from code in other source files and modules. Access levels are as follows:
- Open and Public accesses 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. Open access enables subclassing, as opposed to Public access, which disallows subclassing.
- Internal access enables entities to be used within any source file from their defining module, but not in any source file outside of this module.
- File-private access restricts the use of an entity to its defining source file.
- Private access restricts the use of an entity to its enclosing declaration.
Swift evolution proposals ...