title: Play system sound in iOS 13
body: <p>I used to be able to play system audio files using the code below. This is not working in iOS 13 for both old and new applications.</p>
  
  <pre><code>import AudioToolbox
  import AVFoundation
  
  ...
  
      func tock() {
          do {
              try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category(rawValue: convertFromAVAudioSessionCategory(AVAudioSession.Category.ambient)))
  
              var myAlertSound: SystemSoundID = 0
              let url: URL = URL(string: "/System/Library/Audio/UISounds/Tock.caf")!
              AudioServicesCreateSystemSoundID( (url) as CFURL, &amp;myAlertSound)
              AudioServicesPlaySystemSound(myAlertSound)
          } catch {
              print("Error in audio feedback")
          }
      }
  
      // Helper function inserted by Swift 4.2 migrator.
      private func convertFromAVAudioSessionCategory(_ input: AVAudioSession.Category) -&gt; String {
          return input.rawValue
      }
  </code></pre>
  
  <p>I don't see the "Error in audio feedback" print either. </p>
  
  <p>Is there a way to play simple sounds in iOS 13?</p>