title: UISlider does not drag iOS
body: <p>I am implementing the audio player. But my slider does not drag.</p>
  
  <p>.h</p>
  
  <pre><code>@property (strong, nonatomic) IBOutlet UISlider *currentTimeSlider;
  @property BOOL scrubbing;
  </code></pre>
  
  <p>.m</p>
  
  <pre><code>/*
   * Sets the current value of the slider/scrubber
   * to the audio file when slider/scrubber is used
   */
  - (IBAction)setCurrentTime:(id)scrubber {
      //if scrubbing update the timestate, call updateTime faster not to wait a second and dont repeat it
  
      NSLog(@"%@scrubber",@"drag");
  
      [NSTimer scheduledTimerWithTimeInterval:0.01
                                       target:self
                                     selector:@selector(updateTime:)
                                     userInfo:nil
                                      repeats:NO];
  
      [self.audioPlayer setCurrentAudioTime:self.currentTimeSlider.value];
      self.scrubbing = FALSE;
  }
  
  /*
   * Sets if the user is scrubbing right now
   * to avoid slider update while dragging the slider
   */
  - (IBAction)userIsScrubbing:(id)sender {
      NSLog(@"%@",@"slider drag");
  
      self.scrubbing = TRUE;
  }
  
  /*
   * Updates the time label display and
   * the current value of the slider
   * while audio is playing
   */
  - (void)updateTime:(NSTimer *)timer {
      //to don't update every second. When scrubber is mouseDown the the slider will not set
      if (!self.scrubbing) {
          //self.currentTimeSlider.value = [self.audioPlayer getCurrentAudioTime];
      }
  
        NSLog(self.scrubbing ? @"Yes" : @"No");
  
      if(self.scrubbing)
      {
          NSLog(@"%@ scrubbing",@"sdfs");
      }
      [self.currentTimeSlider addTarget:self
                    action:@selector(sliderDidEndSliding:)
          forControlEvents:(UIControlEventTouchUpInside | UIControlEventTouchUpOutside)];
  
      long currentPlaybackTime = [self.audioPlayer getCurrentAudioTime];
      self.currentTimeSlider.value = currentPlaybackTime / [self.audioPlayer getAudioDuration];
  
      self.timeElapsed.text = [NSString stringWithFormat:@"%@",
                               [self.audioPlayer timeFormat:[self.audioPlayer getCurrentAudioTime]]];
  
      self.duration.text = [NSString stringWithFormat:@"%@",
                            [self.audioPlayer timeFormat:[self.audioPlayer getAudioDuration] - [self.audioPlayer getCurrentAudioTime]]];
  }
  </code></pre>
  
  <p>The slider does not drag even if we drag the slider it moves to the previous position. Any ideas as to why the slider is not dragging.</p>
  
  <p>Thanks,</p>