AVAudioSessionCategoryPlayAndRecord has been renamed to AVAudioSession.Category.playAndRecord
//4.0 try recordingSession.setCategory(AVAudioSessionCategoryPlayAndRecord, with: .defaultToSpeaker)
//4.2 try recordingSession.setCategory(AVAudioSession.Category.playAndRecord, mode: AVAudioSession.Mode.default, options: [])
If this helped you, share and pass it on! 😀 ➡️ 🐦