Before we can play any sound or perform vibrations on our iPhone, we must first import the
AudioToolBox library so that we can make use of its properties and methods:
GetUsersAttentionViewController.mimplementation file and add the following highlighted code as shown in the code snippet below:
#import "GetUsersAttentionViewController.h" #import "AudioToolBox/AudioToolBox.h" @implementation GetUsersAttentionViewController
playAlertSoundmethod. This method will be responsible for playing a short 30 second sound when the Play Alert Sound button is pressed. In the action event which you created for the Play Alert Sound button, add the following ...