The title has it... There is a new sound on iOS 10 that UIPickerView plays each time the selected item is changed. Is there a way to play that sound? Ideally with AudioServicesPlaySystemSound(_) if there is system sound for it or in any other way if there is not any.
I have the same problem and I finally found a solution
AudioServicesPlaySystemSoundWithCompletion(1157, nil);
AudioServicesPlaySystemSound will be deprecated in a future release. Use AudioServicesPlaySystemSoundWithCompletion instead.
If you want to mimic the sound and vibration of UIPickerView, you should also add the following code.
if (@available(iOS 10.0, *)) {
UIImpactFeedbackGenerator *impactFeedBack = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleLight];
[impactFeedBack prepare];
[impactFeedBack impactOccurred];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With