Вот пример, который вас может заинтересовать.
@interface MyUISlider : UISlider
@end
@implementation MyUISlider
UIButton * button;
- (void)awakeFromNib{
[super awakeFromNib];
button = [UIButton buttonWithType:UIButtonTypeSystem];
[self addSubview:button];
button.backgroundColor = UIColor.redColor;
self.maximumValue = 10;
self.minimumValue = 0;
self.continuous = NO;
}
-(void)updateLabel{
[button setTitle:[NSString stringWithFormat:@"%i", (NSInteger)self.value ] forState:UIControlStateNormal];
}
- (CGRect)thumbRectForBounds:(CGRect)bounds trackRect:(CGRect)rect value: (float)value{
CGRect myvalue = [super thumbRectForBounds:bounds trackRect:rect value:value];
button.frame = CGRectMake(myvalue.origin.x-10, myvalue.origin.y - 60, 50, 50);
[self updateLabel];
return myvalue;
}
@end