Skip to content

Commit

Permalink
use macro to check os version
Browse files Browse the repository at this point in the history
  • Loading branch information
yulingtianxia committed Nov 13, 2017
1 parent a7919d8 commit 23849ed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions MessageThrottle/MessageThrottle.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@

static inline BOOL mt_object_isClass(id _Nullable obj)
{
if (@available(iOS 8.0, macOS 10.10, tvOS 9.0, watchOS 2.0, *)) {
return object_isClass(obj);
}
#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
return object_isClass(obj);
#else
if (!obj) return NO;
return obj == [obj class];
#endif
}

Class mt_metaClass(Class cls)
Expand Down

0 comments on commit 23849ed

Please sign in to comment.