Fixed #9 - Automatically update the Camels when Slider changes
This commit is contained in:
parent
f01bb1e2be
commit
3af2a3fa4f
|
|
@ -294,8 +294,13 @@
|
|||
|
||||
#pragma mark - TGPControlsTicksProtocol
|
||||
|
||||
-(void)tgpTicksDistanceChanged:(CGFloat)ticksDistance sender:(id)sender
|
||||
- (void)tgpTicksDistanceChanged:(CGFloat)ticksDistance sender:(id)sender
|
||||
{
|
||||
self.ticksDistance = ticksDistance;
|
||||
}
|
||||
|
||||
- (void)tgpValueChanged:(unsigned int)value
|
||||
{
|
||||
self.value = value;
|
||||
}
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
@protocol TGPControlsTicksProtocol<NSObject>
|
||||
|
||||
@required
|
||||
-(void)tgpTicksDistanceChanged:(CGFloat)ticksDistance sender:(id)sender;
|
||||
- (void)tgpTicksDistanceChanged:(CGFloat)ticksDistance sender:(id)sender;
|
||||
|
||||
@optional
|
||||
- (void)tgpValueChanged:(unsigned int)value;
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -180,6 +180,11 @@ static CGSize iosThumbShadowOffset = (CGSize){0, 3};
|
|||
}
|
||||
|
||||
- (void)sendActionsForControlEvents {
|
||||
// Automatic UIControlEventValueChanged notification
|
||||
if([self.ticksListener respondsToSelector:@selector(tgpValueChanged:)]) {
|
||||
[self.ticksListener tgpValueChanged:self.value];
|
||||
}
|
||||
|
||||
// Interface builder hides the IBInspectable for UIControl
|
||||
#if !TARGET_INTERFACE_BUILDER
|
||||
[self sendActionsForControlEvents:UIControlEventValueChanged];
|
||||
|
|
@ -457,8 +462,6 @@ static CGSize iosThumbShadowOffset = (CGSize){0, 3};
|
|||
- (CGSize)thumbSizeIncludingShadow {
|
||||
switch (self.thumbStyle) {
|
||||
case ComponentStyleInvisible:
|
||||
return CGSizeZero;
|
||||
|
||||
case ComponentStyleRectangular:
|
||||
case ComponentStyleRounded:
|
||||
return ((self.thumbShadowRadius != 0.0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue