summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2013-12-24 00:58:24 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2013-12-24 00:58:24 -0800
commit081571000c5928effb753b8571dfa0f33fe40a9b (patch)
treebfad65de82eb8718ce5de657d3bc9215b52e8c74
parent43f8a0e803bf3cbd8bc61e7236c2a870b8aab501 (diff)
Use userInterfaceIdiom instead of isWildcat for 7.
-rw-r--r--MobileCydia.mm20
-rw-r--r--iPhonePrivate.h4
2 files changed, 5 insertions, 19 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 68b6fbc..aa8ad52 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -10524,12 +10524,6 @@ int main(int argc, char *argv[]) {
UpdateExternalStatus(0);
- if (Class $UIDevice = objc_getClass("UIDevice")) {
- UIDevice *device([$UIDevice currentDevice]);
- IsWildcat_ = [device respondsToSelector:@selector(isWildcat)] && [device isWildcat];
- } else
- IsWildcat_ = false;
-
UIScreen *screen([UIScreen mainScreen]);
if ([screen respondsToSelector:@selector(scale)])
ScreenScale_ = [screen scale];
@@ -10537,18 +10531,14 @@ int main(int argc, char *argv[]) {
ScreenScale_ = 1;
UIDevice *device([UIDevice currentDevice]);
- if (![device respondsToSelector:@selector(userInterfaceIdiom)])
- Idiom_ = @"iphone";
- else {
+ if ([device respondsToSelector:@selector(userInterfaceIdiom)]) {
UIUserInterfaceIdiom idiom([device userInterfaceIdiom]);
- if (idiom == UIUserInterfaceIdiomPhone)
- Idiom_ = @"iphone";
- else if (idiom == UIUserInterfaceIdiomPad)
- Idiom_ = @"ipad";
- else
- NSLog(@"unknown UIUserInterfaceIdiom!");
+ if (idiom == UIUserInterfaceIdiomPad)
+ IsWildcat_ = true;
}
+ Idiom_ = IsWildcat_ ? @"ipad" : @"iphone";
+
Pcre pattern("^([0-9]+\\.[0-9]+)");
if (pattern([device systemVersion]))
diff --git a/iPhonePrivate.h b/iPhonePrivate.h
index 08e0a33..6f4e706 100644
--- a/iPhonePrivate.h
+++ b/iPhonePrivate.h
@@ -246,10 +246,6 @@ typedef enum {
- (void) addTarget:(id)target action:(SEL)action forEvents:(NSInteger)events;
@end
-@interface UIDevice (Apple)
-- (BOOL) isWildcat;
-@end
-
@interface UIImage (Apple)
+ (UIImage *) applicationImageNamed:(NSString *)name;
+ (UIImage *) imageAtPath:(NSString *)path;