Are you talking about 'private' and 'file private'...?
With Swift 4.0, scope of
private
and
fileprivate
is extended.
Private is now accessible within same file, outside actual class/extension. If you declare/define your extension in other file, then your private variable will not be accessible at that time fileprivate will work
File Private
File-private access restricts the use of an entity to its own defining source file. Use file-private access to hide the implementation details of a specific piece of functionality when those details are used within an entire file.
Syntax:
fileprivate <var type> <variable name>
Example:
fileprivate class SomeFilePrivateClass {}
Private
Private access restricts the use of an entity to the enclosing declaration, and to extensions of that declaration that are in the same file. Use private access to hide the implementation details of a specific piece of functionality when those details are used only within a single declaration.
Syntax:
private <var type> <variable name>
Example:
private class SomePrivateClass {}
Here is more detail about all access levels: Swift - Access Levels