iphoneiosavaudioplayeruisliderxcode4.6

How to set volume control using uislider in iphone?


.h file
IBOutlet UISlider *valume;
AVAudioPlayer * player;

-(IBAction)sliderValueChanged:(UISlider *)slider;

.m file

-(IBAction)sliderValueChanged:(UISlider *)slider{


}

how to set volume maximum and minimum using uislider


Solution

  • -(IBAction)sliderValueChanged:(UISlider *)slider{
    
        player.volume=slider.value;
    }