Permalink
Browse files

iOS version check for uicolor function calls

  • Loading branch information...
1 parent 339e14e commit d21cb7bb658f3e2bb2ab2158d192f5a45cf180f2 @GavinRooney GavinRooney committed Jan 28, 2012
Showing with 18 additions and 8 deletions.
  1. +18 −8 Classes/UVStyleSheet.m
View
@@ -58,18 +58,28 @@ + (UIColor *)lightZebraBgColor {
}
+ (UIColor *)topSeparatorColor {
- CGFloat hue, saturation, brightness, alpha;
- UIColor *reference = [[self styleSheet] lightZebraBgColor];
- [reference getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha];
- return [UIColor colorWithHue:hue saturation:saturation - 0.1 brightness:brightness + 0.15 alpha:alpha];
+ if ([[[UIDevice currentDevice] systemVersion] floatValue] > 5.0) {
+ CGFloat hue, saturation, brightness, alpha;
+ UIColor *reference = [[self styleSheet] lightZebraBgColor];
+ [reference getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha];
+ return [UIColor colorWithHue:hue saturation:saturation - 0.1 brightness:brightness + 0.15 alpha:alpha];
+ }
+ else {
+ return [UIColor blueColor];
+ }
}
+ (UIColor *)bottomSeparatorColor {
- CGFloat hue, saturation, brightness, alpha;
- UIColor *reference = [[self styleSheet] darkZebraBgColor];
- [reference getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha];
- return [UIColor colorWithHue:hue saturation:saturation - 0.1 brightness:brightness - 0.2 alpha:alpha];
+ if ([[[UIDevice currentDevice] systemVersion] floatValue] > 5.0) {
+ CGFloat hue, saturation, brightness, alpha;
+ UIColor *reference = [[self styleSheet] darkZebraBgColor];
+ [reference getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha];
+ return [UIColor colorWithHue:hue saturation:saturation - 0.1 brightness:brightness - 0.2 alpha:alpha];
+ }
+ else {
+ return [UIColor blueColor];
+ }
}
+ (UIColor *)tableViewHeaderColor {

0 comments on commit d21cb7b

Please sign in to comment.