Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


In Obj-C extensions you can add variables with the help of Obj-C runtime.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: