- — — — — Garbage Collection vs Automatic Reference Counting — — — — -

There is a direct financial consequence of this. Compare the high-end iPhone vs the high-end Android phones. iPhone 8(2 GB or 3 G​​B) vs the Google Pixel 2, which has 4GB because the apps on the iPhone simply need less RAM than the same apps written on Android.

Garbage Collection

Automatic Reference Counting

//swift implementationvar name: NSString? 
strong var name: NSString?
weak var name: NSString?unretained var name: NSString?

ARC over GC

Thanks for reading.

If you enjoyed this article, feel free to hit that clap button 👏 to help others find it.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store