Why should Swift introduce ‘fileExtensionPrivate’ access modifier?
Yeah, as per the title, you’re reading it surprisingly with a tiny smile on face 🙂!
Get Started
Yes, right now, there is a limit with all the existing modifiers. To understand the limit, let’s first talk about private, filePrivate and internal access modifiers.
Private access modifier:
Private access restricts the use of an entity to the enclosing declaration, and to extensions of that declaration that are in the same file. In the below code, you can see that name is a private property of ViewController class. It is accessible in the ViewController class & also in the extension of ViewController in the same file, but it is not accessible in the other SecondViewController class in the same file.
filePrivate access modifier:
fileprivate access restricts the use of an entity to the source file level. As in the above code, name is…