Skip to content

Instantly share code, notes, and snippets.

@justAnotherDev
Created January 31, 2016 10:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justAnotherDev/81d37533e151018a7ab0 to your computer and use it in GitHub Desktop.
Save justAnotherDev/81d37533e151018a7ab0 to your computer and use it in GitHub Desktop.
Swift Exception Handler - tryBlock
NS_INLINE NSException * _Nullable tryBlock(void(^_Nonnull tryBlock)(void)) {
@try {
tryBlock();
}
@catch (NSException *exception) {
return exception;
}
return nil;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment