Swift provides five different access levels for entities within your code:
- open - is the least restrictive. Anyone can subclass and override.
- public - Anyone can subclass and override within module
- internal - default, allows access within module
- fileprivate - restricts entity to to its own defining source file (even outside the type)
- private - limits to withing the type
Typically we use:
- public / private / internal
- seldom use open, fileprivate