When self should be weakify?

How to diagnose retain cycle and when to use [weak self] to avoid retain cycle.

Aaina jain
Jan 13 · 4 min read
Credit: https://pixabay.com/

Introduction

Often we end up having a memory leak in the project. We know when our closure can increase retain count and when not. When I was executing function [Using self inside] in Notification Center Observer, I had an intuition that it won’t…

Already have an account? Sign in

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade