SWIFT iOS crash report

Hello, I am developing one ios application where I want to implement emergency reporting without using any third-party sdk or classes that I want to write when my application crashes. I implemented NSSetUncaughtExceptionHandler(exceptionHandlerPtr) in didFinishLaunchingWithOptions and added Objective-C code for its handler. The code for my CrashReporting .h file

 volatile void exceptionHandler(NSException *exception); extern NSUncaughtExceptionHandler *exceptionHandlerPtr; 

and CrashReporting.m Code:

 volatile void exceptionHandler(NSException *exception) { // Do stuff NSLog(@"App IS cCrAsSHsED %@",exception.description); NSLog(@"App IS cCrAsSHsED %@",exception.callStackSymbols); // Here i will Compose mail with error description and callStackSymbols. } NSUncaughtExceptionHandler *exceptionHandlerPtr = &exceptionHandler; 

His work is fine, but not capable of handling all type errors. how can I do the same for Fatal Errors and Signal Errors in swift, I searched on Google but found nothing useful for quick. Help will be appreciated. Sorry for my bad english. Thank you

+7
ios exception-handling swift error-handling
source share
1 answer

It's not obligatory. It seems to me that you just want to see crash reports. Apple has already built a crash reporting service that usually (if users hadn’t disabled it) provided crash reports so you can analyze them.

Therefore, there is no need to reinvent the wheel.

0
source share

All Articles