Is it possible to catch a NSInternalInconsistencyException in Swift ? If it is, how could that be done?
It can be done for example with https://github.com/williamFalcon/SwiftTryCatch. First add it to your Podfile:
use_frameworks!
pod 'SwiftTryCatch'
Then in your code import SwiftTryCatch
and then you can catch Objective-C exceptions like this
SwiftTryCatch.try({
// try block
}, catch: { (error) in
// catch block
}, finally: {
// finally block
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With