Skip to content

Instantly share code, notes, and snippets.

@jdelStrother
Created February 19, 2014 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdelStrother/9096635 to your computer and use it in GitHub Desktop.
Save jdelStrother/9096635 to your computer and use it in GitHub Desktop.
// 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