You can:
- Embed the delegate methods in your controller and call them from your view or
- Subclass
UIControland send UIControlEventto your controller
when the values change (more precisely, when the user interacts with your control).
- , UIControl .
iPhone:
UIControl - : , , .
, UIView UIControl , . UIView , UIControl .
UPDATE:
, :
:
@interface MyView : UIView {
id delegate;
}
@property (assign) id delegate;
@end
@synthesize .
:
MyView myView = [[MyView alloc] init];
[myView setDelegate:self];
, , (, touchesBegan), , , :
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
if([delegate respondsToSelector:@selector(valuesChanged)]) {
[delegate valuesChanged];
}
}
< Cocoa.