3 ms·
Swift extensions do not have the ability to add variables to the scope of the class they extend or into their own private scope. Perhaps because the compiler ti
by dep_b 9y ago
Swift extensions do not have the ability to add variables to the scope of the class they extend or into their own private scope. Perhaps because the compiler times would crash through the roof but I find it very limiting. I do use extensions in Swift but I prefer to factor out any code into it's own class once it needs to touch any kind of state.
- perfectstorm 9y agoIn Obj-C extensions you can add variables with the help of Obj-C runtime.