Slide 18
Slide 18 text
ΫϥογϡݕͱϋϯυϦϯά
class func setup() {
// ྫ֎ͷݕͱ࣮ߦ͢Δؔͷࢦఆ
NSSetUncaughtExceptionHandler(exceptionHandler)
// γάφϧͷݕͱ࣮ߦ͢Δؔͷࢦఆ
for sigcontext in [SIGABRT, SIGILL, SIGSEGV, SIGFPE, SIGBUS, SIGPIPE, SIGTRAP] {
signal(sigcontext, signalHandler)
}
}
private static let exceptionHandler: @convention(c) (NSException) -> () = { exeption in
handleSignalException(exeption: exeption)
}
private static let signalHandler: @convention(c) (Int32) -> () = { signal in
handleSignalException()
}
https://stackover
fl
ow.com/questions/36325140/how-to-catch-a-swift-crash-and-do-some-logging