File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ of this software and associated documentation files (the "Software"), to deal
23
23
#import " JSBadgeView.h"
24
24
25
25
#import < QuartzCore/QuartzCore.h>
26
+ #include < mach-o/dyld.h>
26
27
27
28
#if !__has_feature(objc_arc)
28
29
#error JSBadgeView must be compiled with ARC.
@@ -54,19 +55,12 @@ static BOOL JSBadgeViewIsUIKitFlatMode(void)
54
55
#ifndef kCFCoreFoundationVersionNumber_iOS_7_0
55
56
#define kCFCoreFoundationVersionNumber_iOS_7_0 847.2
56
57
#endif
57
-
58
- if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0 )
59
- {
60
- // If your app is running in legacy mode, tintColor will be nil - else it must be set to some color.
61
- if (UIApplication.sharedApplication .keyWindow )
62
- {
63
- isUIKitFlatMode = [UIApplication.sharedApplication.keyWindow performSelector: @selector (tintColor )] != nil ;
64
- }
65
- else
66
- {
67
- // Possible that we're called early on (e.g. when used in a Storyboard). Adapt and use a temporary window.
68
- isUIKitFlatMode = [[[UIWindow alloc ] init ] performSelector: @selector (tintColor )] != nil ;
69
- }
58
+ #ifndef UIKitVersionNumber_iOS_7_0
59
+ #define UIKitVersionNumber_iOS_7_0 0xB57
60
+ #endif
61
+ // We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7.
62
+ if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0 ) {
63
+ isUIKitFlatMode = (NSVersionOfLinkTimeLibrary(" UIKit" ) >> 16 ) >= UIKitVersionNumber_iOS_7_0;
70
64
}
71
65
});
72
66
You can’t perform that action at this time.
0 commit comments