ObjCTry
Simple code wrapper to help catching ObjC exceptions within Swift. It works simply by converting exceptioins to errors and rethrows them to allow Swift do-catch block to catch them.
Requirements
iOS 10.0, Swift 4
Example usage
do {
try ObjC.try {
// code that throws ObjC exceptions
}
} catch {
print(error)
}
Installation
CocoaPods.
ObjCTry is available throughTo install it, simply add the following line to your Podfile:
pod "ObjCTry", "~> 1.1"
Carthage.
ObjCTry is available throughTo install it, simply add the following line to your Carthage file:
github "svetam/ObjCTry" ~> 1.1
Author
Svetislav Markovic ([email protected])
License
ObjCTry is available under the MIT license. See the LICENSE file for more info.