I have a UIViewController, MainViewController
, that presents a SheetViewController
using modalPresentationStyle = .formSheet
. SheetViewController
then presents another ViewController using modalPresentationStyle = .fullScreen
. Doing this causes viewWillDisappear()
to be called on SheetViewController
, but never on MainViewController
.
Since I have some frequent calls to a backend in MainViewController
, I want to be informed when it is not visible, such that I can stop these calls. This could be done using delegates, but can it really be that there is no way that MainViewController
can be informed directly by iOS when it is no longer visible on the screen?