SBSDKExceptionHandler

@interface SBSDKExceptionHandler : NSObject

Helper class to catch NSExceptions from with Swift code.

  • Call a function that may throw an NSException and catch it using the catchBlock.

    Declaration

    Objective-C

    + (void)tryBlock:(void (^_Nonnull)(void))tryBlock
          catchBlock:(void (^_Nonnull)(NSException *_Nonnull))catchBlock;

    Swift

    class func `try`(_ tryBlock: @escaping () -> Void, catch catchBlock: @escaping (NSException) -> Void)

    Parameters

    tryBlock

    A block that contains the calls to the throwing functions.

    catchBlock

    A block being called if an exception is thrown during the execution of the tryBlock.