Cedric Luthi kommentje Steinberger Peter snippetje alatt pontosan leirja:
In order to check which SDK version was used to build a binary, UIKit uses the _UIApplicationLinkedOnOrAfterfunction. It is implemented by comparing the major version of UIKit at link time (NSVersionOfLinkTimeLibrary("UIKit") >> 16) to a value in the __UIKitVersionNumbers table.
Here is this UIKit version numbers table, built by running otool -L on UIKit of all these iOS versions (yes I have a huge archive!):
2.00 x0E5
2.1 0x2EB
2.2 0x2F0
2.2.1 0x2F1
3.0 0x333
3.1 0x3E8
3.2 0x44C
4.0 0x4B0
4.1 0x514
4.2.1 0x578
4.2.6 0x582
4.3 0x5DC
5.0 0x640
5.1 0x6A4
6.0 0x944
6.1 0x94C
7.0 0xB57
7.1 0xB77
Weirdly enough, the __UIKitVersionNumbers contains 0x2EC instead of 0x2EB for iPhone OS 2.1. But since nobody cares at all about iPhone OS 2 this should not be a problem.
Peter is igy allapitja meg, hogy a 7-estol hasznalt flat design-hoz igazodjon vagy meg a regihez:
#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;
}
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.