O'Reilly logo

iOS® 8 for Programmers: An App-Driven Approach with Swift™, Third Edition by Abbey Deitel, Harvey M. Deitel, Paul J. Deitel

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

4.5.2 Model Properties

Figure 4.16 begins class Model’s definition and defines its private properties. Swift provides three access modifierspublic, internal and private. Class members that are declared public can be reused in other apps—for example, you can use the Swift Standard Library’s public features in your apps. Class members declared internal can be used only by other code in the same projectinternal is the default access specifier if you do not provide one. Class members declared private can be used only in the file in which they’re defined.

  11   // manages the saved searches  12   class Model {  13       // keys used for storing app's data in app's NSUserDefaults  14       private let pairsKey =

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