I'm starting in swift and opening a project created using swift2 from xcode 8 beta, the private
modifier were changed to fileprivate
. what does this keyword means? and how is different from private
?
fileprivate
is one of the new Swift 3 access modifiers that replaces private
in its meaning. fileprivate
defines an entity (class, extension, property, ...) as private to everybody outside the source file it is declared in, but accessible to all entities in that source file.
private
restricts the entity in the direct enclosing scope.