Skip to content

Commit 23849ed

Browse files
committed
use macro to check os version
1 parent a7919d8 commit 23849ed

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

MessageThrottle/MessageThrottle.m

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313

1414
static inline BOOL mt_object_isClass(id _Nullable obj)
1515
{
16-
if (@available(iOS 8.0, macOS 10.10, tvOS 9.0, watchOS 2.0, *)) {
17-
return object_isClass(obj);
18-
}
16+
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0 || __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_9_0 || __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_2_0 || __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10
17+
return object_isClass(obj);
18+
#else
1919
if (!obj) return NO;
2020
return obj == [obj class];
21+
#endif
2122
}
2223

2324
Class mt_metaClass(Class cls)

0 commit comments

Comments
 (0)