Skip to content

Instantly share code, notes, and snippets.

@OliverLetterer
Forked from steipete/UIKitLegacyDetector.m
Created December 16, 2013 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OliverLetterer/7984238 to your computer and use it in GitHub Desktop.
Save OliverLetterer/7984238 to your computer and use it in GitHub Desktop.
// Taken from http://PSPDFKit.com. This snippet is under public domain.
#define UIKitVersionNumber_iOS_7_0 0xB57
BOOL PSPDFIsUIKitFlatMode(void) {
static BOOL isUIKitFlatMode = NO;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7.
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) {
isUIKitFlatMode = (NSVersionOfLinkTimeLibrary("UIKit") >> 16) >= UIKitVersionNumber_iOS_7_0;
}
});
return isUIKitFlatMode;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment