AVAudioSession.sharedInstance().requestRecordPermission({ (granted) -> Void in
if !granted
{
let microphoneAccessAlert = UIAlertController(title: NSLocalizedString("recording_mic_access",comment:""), message: NSLocalizedString("recording_mic_access_message",comment:""), preferredStyle: UIAlertControllerStyle.Alert)
var okAction = UIAlertAction(title: NSLocalizedString("OK",comment:""), style: UIAlertActionStyle.Default, handler: { (alert: UIAlertAction!) -> Void in
UIApplication.sharedApplication().openURL(NSURL(string: UIApplicationOpenSettingsURLString)!)
})
var cancelAction = UIAlertAction(title: NSLocalizedString("Cancel",comment:""), style: UIAlertActionStyle.Cancel, handler: { (alert: UIAlertAction!) -> Void in
})
microphoneAccessAlert.addAction(okAction)
microphoneAccessAlert.addAction(cancelAction)
self.presentViewController(microphoneAccessAlert, animated: true, completion: nil)
return
}
self.performSegueWithIdentifier("segueNewRecording", sender: nil)
});