Cocoa Programming for OS X: The Big Nerd Ranch Guide
by Aaron Hillegass, Adam Preble, Nate Chandler
For the More Curious: Access Modifiers
As you have already seen in this chapter, Swift has a mechanism for controlling access to a class, method, or property – among other things. This is done via access modifiers, keywords which are applied to the entities whose visibility is being configured.
In Swift, there are three levels of visibility and three corresponding keywords by which the visibilities are specified:
-
internal -
A class, method, or other entity which has
internalvisibility can be seen from all files inside the same module as the class. An entity withinternalvisibility cannot, however, be seen from files in a different module.internalis the default level of visibility for an entity. When you first add a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access