A simple way to play a sound effect on iOS.
CocoaPods is recommended. Add the following to your Podfile:
pod 'SAMSoundEffect'
You can also just download and put the the two files in your project. You'll need to add AVFoundation to your target as well.
Simple as:
[SAMSoundEffect playSoundEffectNamed:@"shutter"];
You can also do:
SAMSoundEffect *sound = [SAMSoundEffect soundEffectNamed:@"shutter"];
[sound play];
You can interrupt it too:
[sound stop];
You'll probably want to add this in your application:didFinishLaunchingWithOptions:
so they don't stop audio from other applications.
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];