Created
September 5, 2010 08:23
-
-
Save danielctull/565853 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIDevice+DTFeatureCheck.h | |
// DTUIKit | |
// | |
// Created by Daniel Tull on 02.08.2010. | |
// Copyright 2010 Daniel Tull. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@interface UIDevice (DTFeatureCheck) | |
- (BOOL)dt_multitaskingSupported; | |
- (BOOL)dt_blocksSupported; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIDevice+DTFeatureCheck.m | |
// DTUIKit | |
// | |
// Created by Daniel Tull on 02.08.2010. | |
// Copyright 2010 Daniel Tull. All rights reserved. | |
// | |
#import "UIDevice+DTFeatureCheck.h" | |
#import "UIDevice+DTSystemVersion.h" | |
@implementation UIDevice (DTFeatureCheck) | |
- (BOOL)dt_multitaskingSupported { | |
if (![self respondsToSelector:@selector(isMultitaskingSupported)]) return NO; | |
return self.multitaskingSupported; | |
} | |
- (BOOL)dt_blocksSupported { | |
return ([self dt_majorSystemVersion] >= 4); | |
} | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIDevice+DTSystemVersion.h | |
// DTUIKit | |
// | |
// Created by Daniel Tull on 26.06.2009. | |
// Copyright 2009 Daniel Tull. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIDevice (DTSystemVersion) | |
- (NSInteger)dt_majorSystemVersion; | |
- (NSInteger)dt_minorSystemVersion; | |
- (NSInteger)dt_maintenanceSystemVersion; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIDevice+DTSystemVersion.m | |
// DTUIKit | |
// | |
// Created by Daniel Tull on 26.06.2009. | |
// Copyright 2009 Daniel Tull. All rights reserved. | |
// | |
#import "UIDevice+DTSystemVersion.h" | |
@interface UIDevice () | |
- (NSInteger)dtInternal_systemVersionComponentAtIndex:(NSInteger)index; | |
@end | |
@implementation UIDevice (DTSystemVersion) | |
- (NSInteger)dtInternal_systemVersionComponentAtIndex:(NSInteger)index { | |
NSArray *components = [self.systemVersion componentsSeparatedByString:@"."]; | |
if ([components count] <= index) return -1; | |
return [[components objectAtIndex:index] integerValue]; | |
} | |
- (NSInteger)dt_majorSystemVersion { | |
return [self dtInternal_systemVersionComponentAtIndex:0]; | |
} | |
- (NSInteger)dt_minorSystemVersion { | |
return [self dtInternal_systemVersionComponentAtIndex:1]; | |
} | |
- (NSInteger)dt_maintenanceSystemVersion { | |
return [self dtInternal_systemVersionComponentAtIndex:2]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment