Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System "tock" sound missing in iOS 7

Tags:

ios

ios7

audio

In iOS 6 I used this line:

NSString *path  = [[NSBundle bundleWithIdentifier:@"com.apple.UIKit"] pathForResource:@"Tock" ofType:@"aiff"];

to get the path to the system tock sound. Everything was alright. Now since iOS 7, (null) is returned as the path.

Can anyone tell me what happened to the tock sound?

I already tried relinking the UIKit.framework library and got the same result. I just can´t find the reason why this line changed it´s result.

Thanks for your help!

like image 376
Philipp Otto Avatar asked Sep 20 '13 14:09

Philipp Otto


3 Answers

Doing a quick research in the resources for the SDK, it's not there anymore.

[dbarden@Daniels-MacBook-Pro-3/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs]
[16:24:03]% find . -name Tock.aiff
./iPhoneSimulator5.1.sdk/System/Library/Frameworks/UIKit.framework/Tock.aiff
./iPhoneSimulator6.0.sdk/System/Library/Frameworks/UIKit.framework/Tock.aiff
./iPhoneSimulator6.1.sdk/System/Library/Frameworks/UIKit.framework/Tock.aiff
like image 182
Daniel Barden Avatar answered Nov 12 '22 06:11

Daniel Barden


List of all available system sounds in iOS: iOSSystemSoundsLibrary.

You can test all sounds with this small demo app

like image 8
TUNER88 Avatar answered Nov 12 '22 06:11

TUNER88


This post is top on Google about the topic, so I'll add an alternative answer that took me way too much time to find.

The file is no longer included in the com.apple.UIKit bundle because it's not intended to be used directly anymore. Since iOS 4.2, the intended method to play this sound is

[[UIDevice currentDevice] playInputClick];

Hopefully, this prevents anyone else from wasting time trying to find an alternative solution.

like image 3
Holly Avatar answered Nov 12 '22 05:11

Holly