Narek  Simonyan Narek Simonyan - 18 days ago 8
Swift Question

Handle all unhandled exceptions swift

Is there any function like this


void App_UnhandledException(object sender, UnhandledExceptionEventArgs
e)


like in windows phone,for handling all exceptions to send to my server

Answer

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

EDIT

Thanks for Martin R's comment, Swift now supports it.

Comments