iOS: How to Play Sound in Swift

Playing sound in your iOS app is essential because it can add better user experience. This article will guide you how to play sound in Swift. In this case, we will use a class AVAudioPlayer from AVFoundation package. This class provides playback of audio data from a file or memory.