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

Personally, I find that this only really comes up rarely. Most of the time strong references are fine.


My iOS code is loaded with weak/strong ref handling logic. It comes up all the time when using closures in UIKit.


UIKit is kind of annoying because it’s really not “idiomatic” Swift: it’s a wrapper around Objective-C (albeit, a very nice one) that happens to bring along with it a bunch of decisions that lead to having to deal with reference lifetimes.


That could be. I'll admit I haven't used Swift at all outside of coding Appkit/UIKit apps.


iOS Swift is usually the front-end code which means that you're doing a lot of connections to data sources elsewhere. Non-blocking connections always need a weak/strong dance. If you're using Swift for logic most of that is gone.




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

Search: