Swift extensions cannot contain stored properties:
Because properties need storage, adding properties would change the memory structure of the class
If we look closely at the runtime class struct, the Ivar list holds the property storage, and the method list also holds details about the methods that invoke the class objects. And extensions add features in the form of methods to the classes. The extraSpace
in a class struct holds the extension struct. Since we can add methods to extensions this way even after the objects have been created -- and to hold the extension methods, memory has to be allocated -- why can't we add ivars?