iOS: Perform action before any alert appears and any sheet opens

Hello!

Is there a way to perform an action before alert (no matter which) appears and sheet (no matter which) opens? Perhaps, system event or something like this.

iOS: Perform action before any alert appears and any sheet opens
 
 
Q