Is there a way to detect if anything changes on
UIViewController (current view) in the whole UI hierarchy?
I would like to shut off a certain service at background when user have touch/trigger any event in current view without knowing what interaction user provided. For example, I have a network service running at background when user first land on the view, if they swipe or navigate to other page, i need to close the service before the view changes happen.
If your views number is changing you can simply use
to check it after your operation.
If you just want to test when you first show or leave you can use ViewDidAppear() or ViewDidDisappear() to check you operation as Teja said.