enfix
enfix

Reputation: 6970

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.

Upvotes: 1

Views: 105

Answers (2)

Paulw11
Paulw11

Reputation: 114783

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.

Upvotes: 2

Rafał Sroka
Rafał Sroka

Reputation: 40030

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);

Upvotes: 1

Related Questions