RSS

(root)/iphone/common : 63 : source/NSObject_DeviceDetection.m

To get this branch, use:
bzr branch /browse/iphone/common

« back to all changes in this revision

Viewing changes to source/NSObject_DeviceDetection.m

Dömötör Gulyás
2010-04-12 09:25:47
Revision ID: dognotdog@gmail.com-20100412072547-sx17cmyssarjtxcu
adds device detection category to NSObject

Show diffs side-by-side

added added

removed removed

 
1
//
 
2
//  NSObject_DeviceDetection.m
 
3
//  Jigs
 
4
//
 
5
//  Created by döme on 12.04.2010.
 
6
//  Copyright 2010 __MyCompanyName__. All rights reserved.
 
7
//
 
8
 
 
9
#import "NSObject_DeviceDetection.h"
 
10
 
 
11
 
 
12
@implementation NSObject (DeviceDetection)
 
13
 
 
14
- (BOOL) isItAPad
 
15
{
 
16
        #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
 
17
                return UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad;
 
18
        #else
 
19
                return NO;
 
20
        #endif
 
21
}
 
22
 
 
23
- (BOOL) isItAPhone
 
24
{
 
25
        #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
 
26
                return UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone;
 
27
        #else
 
28
                return YES;
 
29
        #endif
 
30
}
 
31
 
 
32
@end
 
33
 

Loggerhead 1.17 is a web-based interface for Bazaar branches