Created
February 19, 2014 17:13
-
-
Save jdelStrother/9096635 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
// In a UIView subclass: | |
@interface MySlider | |
@property CGFloat min, max; | |
@end | |
@implementation MySlider | |
-(void)setMin:(CGFloat)value { | |
_min = value; | |
[self setNeedsDisplay]; | |
} | |
-(void)setMax:(CGFloat)value { | |
_max = value; | |
[self setNeedsDisplay]; | |
} | |
... etc for setValue, setColor, setFoo..... | |
@end | |
// Another example, from an NSManagedObject subclass: | |
-(void)setTitle:(NSString *)title { | |
[self willChangeValueForKey:@"title"]; | |
[self setPrimitiveTitle:title]; | |
[self didChangeValueForKey:@"title"]; | |
_needsSearchTextUpdating = YES; | |
} | |
-(void)setTextDescription:(NSString *)textDescription { | |
[self willChangeValueForKey:@"textDescription"]; | |
[self setPrimitiveTextDescription:textDescription]; | |
[self didChangeValueForKey:@"textDescription"]; | |
_needsSearchTextUpdating = YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment