'How can I detect (programmatically) when openPKPassLibrary() is 'opened' / closed?

I understand that calling openPKPassLibrary() will open it, however - I would like to know when it is closed and how I can detect that and write code for that.

I have a button that is animating when I tap it and the button calls openPKPassLibrary() and then I've tried stopping the button animation in viewDidDisappear() in the button's hosted UIViewController, but it doesn't work. I think this is because the system isn't changing view controllers.

Right now, I am running a dispatch to stop it after openPKPassLibrary() is called but I want to know when it closes.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source