Understanding elements that compose a class
So far, we have worked with a very simple class and many instances of this class in the Playground, the Swift REPL and the web-based Swift Sandbox. Now, it is time to dive deep into the different members of a class.
The following list enumerates the most common element types that you can include in a class definition in Swift and their equivalents in other programming languages. We have already worked with a few of these elements:
Initializers: These are equivalent to constructors in other programming languages
Deinitializers: These are equivalent to destructors in other programming languages
Type properties: These are equivalent to class fields or class attributes in other programming languages
Type methods: These are equivalent to class methods in other programming languages
Subscripts: These are also known as shortcuts
Instance properties: These are equivalent to instance fields or instance attributes in other programming languages
Instance methods...