10.5 Defining Methods
The methods of a class are essentially code routines that can be called upon to perform specific tasks within the context of that class.
Methods come in two different forms, type methods and instance methods. Type methods operate at the level of the class, such as creating a new instance of a class. Instance methods, on the other hand, operate only on the instances of a class (for example performing an arithmetic operation on two property variables and returning the result).
Instance methods are declared within the opening and closing braces of the class to which they belong and are declared using the standard Swift function declaration syntax.
Type methods are declared in the same way as instance methods with the exception that the declaration is preceded by the class keyword.
For example, the declaration of a method to display the account balance in our example might read as follows:
class BankAccount {
...