O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 internal visibility can be seen from all files inside the same module as the class. An entity with internal visibility cannot, however, be seen from files in a different module.

internal is the default level of visibility for an entity. When you first add a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required