Is there any function like this
void App_UnhandledException(object sender, UnhandledExceptionEventArgs
You can set NSSetUncaughtExceptionHandler in your AppDelegate, refer to this post
But Swift does not fully support it, as explain in this post, you need to do it in Objective-C
Thanks for Martin R's comment, Swift now supports it.