简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM