I want to check whenever the user swipes a popped viewController away. So for example when in whatsApp a user exits the current chat by swiping from the edge. How is that possible in Swift?

I don't want to use viewDidDisappear, because this method also gets called when another viewController is presented over the current viewController.