mirror of
https://github.com/HaishinKit/HaishinKit.swift.git
synced 2026-06-06 20:17:36 +00:00
22 lines
660 B
Objective-C
22 lines
660 B
Objective-C
#import <UIKit/UIKit.h>
|
|
|
|
static NSString *const __nonnull HaishinKitIdentifier = @"com.haishinkit.HaishinKit";
|
|
FOUNDATION_EXPORT double HaishinKitVersionNumber;
|
|
FOUNDATION_EXPORT const unsigned char HaishinKitVersionString[];
|
|
|
|
// @see http://stackoverflow.com/questions/35119531/catch-objective-c-exception-in-swift
|
|
NS_INLINE void nstry(void(^_Nonnull lambda)(void), void(^_Nullable error)(NSException *_Nonnull exception)) {
|
|
@try {
|
|
lambda();
|
|
}
|
|
@catch (NSException *exception) {
|
|
if (error != NULL) {
|
|
@try {
|
|
error(exception);
|
|
}@catch(NSException *exception) {
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|