Q: Changing volume slider position when volume buttons pressed How can I connect volume buttons with my volume slider?
I am using AVAudioPlayer and slider volume and physical volume buttons are working fine but the thing is that they are working separately, so what I need to achieve is that when I am pressing physical volume button by volume slider also change position. 
My code is as per below:
-(IBAction)btnClked:(id)sender {

    NSURL *musicFile;

    musicFile = [NSURL fileURLWithPath:[[NSBundle mainBundle]
                                        pathForResource:@"music"
                                        ofType:@"mp3"]];

    myAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:musicFile error:nil];

    [self.button setBackgroundImage:[UIImage imageNamed:@"Play.png"] forState:UIControlStateNormal];

    if (self.button.tag == 0) {
        self.button.tag = 1;
        [self.button setImage:[UIImage imageNamed:@"Stop.png"] forState:UIControlStateNormal];

        [myAudio play];
        myAudio.numberOfLoops = -1;
        myAudio.currentTime = 0;
        myAudio.volume = 0.5;

    } else {
        self.button.tag = 0;
        [self.button setImage:[UIImage imageNamed:@"Play.png"] forState:UIControlStateNormal];
        [myAudio stop];

    }
}

My slider change method looks like this:
- (IBAction)sliderChange:(UISlider *)sender {
    myAudio.volume = sender.value / 1;
}

Thanks in advance!

A: use this MPVolumeView to setup volume slider u can customize it your way...
- (void)showTheVolumeSlider :(UIView *)viewVolumeParent{

    MPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame:viewVolumeParent.bounds] ;
    volumeView.showsRouteButton = NO;
    [viewVolumeParent addSubview:volumeView];
//    [volumeView setVolumeThumbImage:[UIImage imageNamed:@"thumb.png"] forState:UIControlStateNormal];

    [[volumeView subviews] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        if ([obj isKindOfClass:[UISlider class]]) {

            [obj setThumbImage:[UIImage imageNamed:@"thumb.png"]forState:UIControlStateNormal];
            *stop = YES;
        }
    }];
}

