简体   繁体   中英

IOS - Click in Settings.bundle

I need to do a simple action when user click in multi value list in my preference app (in Settings system) I show a simple list of my custom sound (like whatsapp or others app did) but instead of putting its on the app tab o same I'd like to put in my preferences.
When user selects a sound (ringtone) I'd like to play the selected sound (like a preview).

Is it possible ? No problem with the list, but I have no idea to handle the click.

If you are talking about the iOS preferences application, then no, it is not possible. You cannot modify the operation of this application to run your own code.

If you want to play a sample of the selected sound then you will need to implement this in a preferences section of your own app.

Here is how to play a short sound.

NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"yourSound" ofType:@"aif"];
SystemSoundID soundID;
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath: soundPath], &soundID);
AudioServicesPlaySystemSound (soundID);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM