1

Quoting the Swift Programming Language Guide :

Extensions can add new computed properties, but they cannot add stored properties, or add property observers to existing properties.

Why is that ? What's the technical or logical reason behind this ?

Ambroise Collon
  • 3,699
  • 3
  • 16
  • 35

1 Answers1

3

In simple words

Because properties need storage, adding properties would change the memory structure of the class

Prashant Tukadiya
  • 14,902
  • 4
  • 56
  • 85