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
ObjCTry is available through CocoaPods.
To install it, simply add the following line to your Podfile:
pod "ObjCTry", "~> 1.1"ObjCTry is available through Carthage.
To install it, simply add the following line to your Carthage file:
github "svetam/ObjCTry" ~> 1.1Author
Svetislav Markovic ([email protected])
License
ObjCTry is available under the MIT license. See the LICENSE file for more info.