How to use weak self in Swift | Continued Learning #18

Описание к видео How to use weak self in Swift | Continued Learning #18

Swift uses Automatic Reference Counting (ARC) to manage your app’s memory usage. As a developer, you want to try to keep the ARC count as low as possible, which will keep your app running fast and efficiently. In this video we will learn how to use "weak references" instead of "strong references" to keep our count low!

This can be quite a confusing topic for new developers, so we will first spend some time reviewing the problem before learning how to implement the solution.

Learn more about ARC: https://docs.swift.org/swift-book/Lan...

Learn more about weak self: https://www.avanderlee.com/swift/weak...

*Note: I am aware that Swift also has "unowned self" which is often mentioned with "weak self". However, if you use "unowned" incorrectly, it will crash you app. Therefore I am only teaching "weak self" in this course as it is safer and more common.

Next video:    • How to use Typealias in Swift | Conti...  
Last video:    • Multi-threading with background threa...  

🤙 WELCOME BACK 🤙

WEBSITE: https://www.swiftful-thinking.com

DISCORD:   / discord  

GITHUB: https://github.com/SwiftfulThinking/

SAY THANKS: https://www.buymeacoffee.com/nicksarno

Комментарии

Информация по комментариям в разработке