You use the
static var
keywords to declare a:Type property.
Instance property.
Read-only computed instance property.
You use the
static let
keywords to declare a:Mutable type property.
Immutable instance property.
Immutable type property.
An instance-stored property:
Has its own and independent value for each instance of a class.
Has the same value for all the instances of a class.
Has the same value for all the instances of a class, unless it is accessed through the class name followed by dot and the property name.
A class that exposes mutable properties will:
Generate immutable instances.
Generate mutable instances.
Generate mutable classes but immutable instances.
An instance method:
Cannot access instance properties.
Can access instance properties.
Can access only type properties.
You're reading from Object???Oriented Programming with Swift 2
The rest of the page is locked
You have been reading a chapter from
Object???Oriented Programming with Swift 2Published in: Jan 2016Publisher: ISBN-13: 9781785885693
© 2016 Packt Publishing Limited All Rights Reserved