Section 20: Extensions


Extensions add functionality to class, enumeration and structure types. These can be used to extend types where the original source code is unknown. Extensions can add properties, initialisers, methods, subscripts, nested types and make a type conform to a protocol.

Extensions resource sheet

Posted in Chapter 2: Language Guide