I'm trying to play a sound in Swift 4 iOS 12 with Xcode 10. I have a project where I already did that and I'm copying the code from that project.
But now when executing the following code:
try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playAndRecord, mode: .default)
I get the following error in this exact line:
Type 'AVAudioSession.Category' (aka 'NSString') has no member 'playAndRecord'
I already imported AVFoundation so I have no idea is not working.