view raw
Narek  Simonyan Narek Simonyan - 6 months ago 57
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.