April 2017
Intermediate to advanced
316 pages
9h 33m
English
Extensions add new functionality to an existing class, structure, enumeration, or protocol. This includes the ability to extend types for which we do not have access to the original source code.
Extensions in Swift enables us to perform the following:
Extensions enable us to add new functionality to a type, but we will not be able to override the existing functionality.
In the following example, we extend AType by making it conform to two protocols:
extension AType: AProtocol, BProtocol { }
The following example ...
Read now
Unlock full access