This article has been helpful in understanding the new access specifiers in Swift 3
. It also gives some examples of different usages of fileprivate
filePrivate - access controll level is within the file.
case 1: If we create extension with in same class file and try to access fileprivate function or fileprivate property in its extension - access allowed
case 2: If we create a extension of class in new file - And now try to access fileprivate function or fileprivate property - access not allowed
private - access control level is with in lexical scope
case 1: If property or function is declared as private in class - then scope is by default the class. case 2: if private instance is declared with in function body - then scope of instance is limited to function body.