mirror of
https://github.com/zhigang1992/RETableViewManager.git
synced 2026-06-17 05:29:59 +08:00
Set UIKit detection as a static method
This commit is contained in:
@@ -48,11 +48,23 @@
|
||||
|
||||
@protocol RETableViewManagerDelegate;
|
||||
|
||||
/**
|
||||
Returns device OS major version.
|
||||
*/
|
||||
NSUInteger REDeviceSystemMajorVersion();
|
||||
BOOL REDeviceIsUIKit7();
|
||||
static BOOL REDeviceIsUIKit7()
|
||||
{
|
||||
static BOOL isUIKitFlatMode = NO;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) {
|
||||
// If your app is running in legacy mode, tintColor will be nil - else it must be set to some color.
|
||||
if (UIApplication.sharedApplication.keyWindow) {
|
||||
isUIKitFlatMode = [UIApplication.sharedApplication.delegate.window performSelector:@selector(tintColor)] != nil;
|
||||
} else {
|
||||
// Possible that we're called early on (e.g. when used in a Storyboard). Adapt and use a temporary window.
|
||||
isUIKitFlatMode = [[UIWindow new] performSelector:@selector(tintColor)] != nil;
|
||||
}
|
||||
}
|
||||
});
|
||||
return isUIKitFlatMode;
|
||||
}
|
||||
|
||||
/**
|
||||
`RETableViewManager` allows to manage the content of any `UITableView` with ease, both forms and lists. `RETableViewManager` is built on top of reusable cells technique and provides
|
||||
|
||||
@@ -25,23 +25,6 @@
|
||||
|
||||
#import "RETableViewManager.h"
|
||||
|
||||
BOOL REDeviceIsUIKit7() {
|
||||
static BOOL isUIKitFlatMode = NO;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) {
|
||||
// If your app is running in legacy mode, tintColor will be nil - else it must be set to some color.
|
||||
if (UIApplication.sharedApplication.keyWindow) {
|
||||
isUIKitFlatMode = [UIApplication.sharedApplication.delegate.window performSelector:@selector(tintColor)] != nil;
|
||||
} else {
|
||||
// Possible that we're called early on (e.g. when used in a Storyboard). Adapt and use a temporary window.
|
||||
isUIKitFlatMode = [[UIWindow new] performSelector:@selector(tintColor)] != nil;
|
||||
}
|
||||
}
|
||||
});
|
||||
return isUIKitFlatMode;
|
||||
}
|
||||
|
||||
@interface RETableViewManager ()
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
|
||||
<false/>
|
||||
<key>IDESourceControlProjectIdentifier</key>
|
||||
<string>8477F0B3-7B50-4DEE-9405-A3B6471912C9</string>
|
||||
<key>IDESourceControlProjectName</key>
|
||||
<string>RETableViewManagerExample</string>
|
||||
<key>IDESourceControlProjectOriginsDictionary</key>
|
||||
<dict>
|
||||
<key>00213686-1ACC-46C9-9B90-2769BCA1244F</key>
|
||||
<string>ssh://github.com/romaonthego/RETableViewManager.git</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectPath</key>
|
||||
<string>RETableViewManagerExample/RETableViewManagerExample.xcworkspace</string>
|
||||
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
||||
<dict>
|
||||
<key>00213686-1ACC-46C9-9B90-2769BCA1244F</key>
|
||||
<string>../..</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectURL</key>
|
||||
<string>ssh://github.com/romaonthego/RETableViewManager.git</string>
|
||||
<key>IDESourceControlProjectVersion</key>
|
||||
<integer>110</integer>
|
||||
<key>IDESourceControlProjectWCCIdentifier</key>
|
||||
<string>00213686-1ACC-46C9-9B90-2769BCA1244F</string>
|
||||
<key>IDESourceControlProjectWCConfigurations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
|
||||
<string>public.vcs.git</string>
|
||||
<key>IDESourceControlWCCIdentifierKey</key>
|
||||
<string>00213686-1ACC-46C9-9B90-2769BCA1244F</string>
|
||||
<key>IDESourceControlWCCName</key>
|
||||
<string>RETableViewManager</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
Reference in New Issue
Block a user