I notice if I pop a view controller off a UINavigationController's navigation stack using the interactivePopGestureRecognizer, every so often the view controller being popped off is not being released from memory.
Haven't been able to come up with a workaround or determine anything that seems to make the issue reproduce reliably. I simply log out dealloc in the view controller that is going to be popped. Push and pop a few times and notice that dealloc doesn't log out after it is being popped off.
Not sure if something in the UI (other animation) that is interrupting the pop gesture's _UINavigationInteractiveTransition ...
I haven't been able to track down what is retaining my view controller. When the issue happens I can see it is still in memory (I have it listen to UISceneWillEnterForegroundNotification and I put the scene in the background then move it to the foreground and hit a breakpoint).
But...I can't seem to figure out what is strongly retaining the view controller. From he debugger I start setting view controller properties to nil to see if I can break a potential retain cycle I created) but no luck. I'm only able to reproduce the memory leak when I dismiss the view controller with the interactive pop gesture (not the back button). I know that's not a lot to go on but am wondering if someone has experience anything similar and has a potential workaround?