Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change color ivar names for clarity.

  • Loading branch information...
commit 8fab00e16aad6dbebc85b9abb54e1b73dcdf4f2a 1 parent 65fe600
@fcanas authored
View
2  FCColorPickerViewController.h
@@ -28,7 +28,7 @@
@property (readwrite, nonatomic, retain) IBOutlet UIImageView *hueSatImage;
@property (readwrite, nonatomic, retain) IBOutlet UIImageView *crossHairs;
@property (readwrite, nonatomic, retain) IBOutlet UIImageView *brightnessBar;
-@property (readwrite, nonatomic, retain) IBOutlet FCColorSwatchView *colorSwatch;
+@property (readwrite, nonatomic, retain) IBOutlet FCColorSwatchView *swatch;
- (IBAction) chooseSelectedColor;
- (IBAction) cancelColorSelection;
View
8 FCColorPickerViewController.m
@@ -40,7 +40,7 @@ -(void)viewWillAppear:(BOOL)animated {
[self updateBrightnessPosition];
[self updateGradientColor];
[self updateCrosshairPosition];
- _colorSwatch.swatchColor = _color;
+ _swatch.color = _color;
}
-(void)viewWillLayoutSubviews {
@@ -60,7 +60,7 @@ -(void) _setColor:(UIColor *)newColor {
[newColor retain];
[_color release];
_color = newColor;
- _colorSwatch.swatchColor = _color;
+ _swatch.color = _color;
[self updateGradientColor];
}
}
@@ -111,7 +111,7 @@ - (void) updateHueSatWithMovement : (CGPoint) position {
alpha:1.0];
[self _setColor:_tcolor];
- _colorSwatch.swatchColor = _color;
+ _swatch.color = _color;
}
- (void) updateBrightnessWithMovement : (CGPoint) position {
@@ -124,7 +124,7 @@ - (void) updateBrightnessWithMovement : (CGPoint) position {
alpha:1.0];
[self _setColor:_tcolor];
- _colorSwatch.swatchColor = _color;
+ _swatch.color = _color;
}
#pragma mark -
View
3  FCColorSwatchView.h
@@ -8,9 +8,8 @@
#import <UIKit/UIKit.h>
-
@interface FCColorSwatchView : UIView
-@property (readwrite, retain, nonatomic) UIColor *swatchColor;
+@property (readwrite, retain, nonatomic) UIColor *color;
@end
View
14 FCColorSwatchView.m
@@ -21,23 +21,23 @@ -(id)initWithCoder:(NSCoder *)aDecoder {
-(void)setupLayers {
CALayer *layer = self.layer;
- [layer setBackgroundColor:self.swatchColor.CGColor];
+ [layer setBackgroundColor:self.color.CGColor];
[layer setCornerRadius:7];
[layer setBorderWidth:1.0f];
[layer setBorderColor:[UIColor grayColor].CGColor];
}
--(void)setSwatchColor:(UIColor *)swatchColor {
- if (_swatchColor != swatchColor) {
+-(void)setColor:(UIColor *)swatchColor {
+ if (_color != swatchColor) {
[swatchColor retain];
- [_swatchColor release];
- _swatchColor = swatchColor;
- [self.layer setBackgroundColor:_swatchColor.CGColor];
+ [_color release];
+ _color = swatchColor;
+ [self.layer setBackgroundColor:_color.CGColor];
}
}
- (void)dealloc {
- self.swatchColor = nil;
+ self.color = nil;
[super dealloc];
}
Please sign in to comment.
Something went wrong with that request. Please try again.