3

Does any of you know what event I can tap into on the DatePicker when the wheel moves.

I want to play a sound (got sound code) as the wheel spin. Just like the timer set picker in Apple's clock app.

All that is there is a single event for ValueChanges which only fires once, at the end of a wheel spin.

Thanks in advance

  • To clarify - I would need to disable the existing click sound and add a new sound to the same event. Thanks – DecodingSand Jun 20 '10 at 07:58
  • possible duplicate of [Can I disable UIPickerView scroll sound?](http://stackoverflow.com/questions/1441849/can-i-disable-uipickerview-scroll-sound) – JosephH Jul 10 '13 at 11:34

3 Answers3

1

I'm not sure this is possible, as the sounds seem to be linked to the Keyboard Clicks in the phone settings. Maybe someone else has a solution, but it doesn't seem to be documented anywhere.

1

There is an undocumented method for doing this: Disable UIPickerView sound

#import <UIKit/UIKit.h>

@interface SilentUIPickerView: UIPickerView
{ }

- (void) setSoundsEnabled: (BOOL) enabled;
@end

use this subclass and call [view setSoundsEnabled: NO]

Community
  • 1
  • 1
james_womack
  • 10,028
  • 6
  • 55
  • 74
0

the reason behind this is when your controller is load the datepickr is scrolling so in view did load write this code.

NSDate *d = [[NSDate alloc] init];
[objDatePicker setDate:d animated:NO];
PJR
  • 13,052
  • 13
  • 64
  • 104