YouTip LogoYouTip

Att Ios Ui Sliders

## Using iOS Sliders Sliders are used to select a value from a range of values. Important Properties * continuous * maximumValue * minimumValue * value ### Important Methods - (void)setValue:(float)value animated:(BOOL)animated ### Adding Custom Methods addSlider and sliderChanged -(IBAction)sliderChanged:(id)sender{ NSLog(@"SliderValue %f",mySlider.value);}-(void)addSlider{ mySlider = [ initWithFrame:CGRectMake(50, 200, 200, 23)]; [self.view addSubview:mySlider]; mySlider.minimumValue = 10.0; mySlider.maximumValue = 99.0; mySlider.continuous = NO; [mySlider addTarget:self action:@selector(sliderChanged:) forControlEvents:UIControlEventValueChanged];} ### Modifying viewDidLoad in ViewController.m as shown below (void)viewDidLoad { ; ;} ### Output Now when we run the application, we will see the following output ![Image 3: sliderOutput1](#) When dragging the slider, the effect is as follows: ![Image 4: sliderOutput2](#)
← Att Ios Ui AlertsAv Event Canplay β†’