What does 'fileprivate' keyword means in Swift?

SwiftPrivateAccess Modifiers

Swift Problem Overview


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 ?

Swift Solutions


Solution 1 - Swift

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNathanielView Question on Stackoverflow
Solution 1 - SwiftJansView Answer on Stackoverflow