Controlling Access

  • Scott Gardner


As alluded to in Chapter 2, Swift takes an innovative and broad-based approach to access control. This is especially evident when compared with Objective-C, where true access control is limited to instance variables—of which usage has been discouraged in favor of properties for several years. This chapter will provide an example of how circumventing intentional access control can be achieved, followed by an in-depth explanation of access control in Swift, aided by examples to help demonstrate each use case.


Access Control Source File Instance Variable Access Level Nest Type 

Copyright information

© Scott Gardner 2014

Authors and Affiliations

  • Scott Gardner
    • 1
  1. 1.NYUS

Personalised recommendations