Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (24 sloc) 0.789 kB
//
// UIDevice+DTVersion.m
// CoreTextExtensions
//
// Created by Oliver Drobnik on 5/30/11.
// Copyright 2011 Drobnik.com. All rights reserved.
//
#import "UIDevice+DTSimpleVersion.h"
@implementation UIDevice (DTSimpleVersion)
- (DTSimpleVersion) osVersion
{
static DTSimpleVersion retVersion;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSString* versionString = [self systemVersion];
NSArray *parts = [versionString componentsSeparatedByString:@"."];
NSUInteger partCount = [parts count];
retVersion.major = (partCount>0)?[[parts objectAtIndex:0] intValue]:0;
retVersion.minor = (partCount>1)?[[parts objectAtIndex:1] intValue]:0;
retVersion.point = (partCount>2)?[[parts objectAtIndex:2] intValue]:0;
});
return retVersion;
}
@end
Jump to Line
Something went wrong with that request. Please try again.