Permalink
Browse files

DRY-ed up GradientView.m

  • Loading branch information...
jacobrelkin committed Dec 9, 2011
1 parent 6a451bf commit be93af501f41b77d96faaa951dd18f4dddc7c5e2
Showing with 3 additions and 9 deletions.
  1. +3 −9 TableView/GradientView.m
View
@@ -45,15 +45,9 @@ - (void)setupGradientLayer
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
- if (self)
- {
- CAGradientLayer *gradientLayer = (CAGradientLayer *)self.layer;
- gradientLayer.colors =
- [NSArray arrayWithObjects:
- (id)[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0].CGColor,
- (id)[UIColor colorWithRed:0.85 green:0.85 blue:0.85 alpha:1.0].CGColor,
- nil];
- self.backgroundColor = [UIColor clearColor];
+ if (self)
+ {
+ [self setupGradientLayer];
}
return self;
}

0 comments on commit be93af5

Please sign in to comment.