How to play a sound using Swift?

Most preferably you might want to use AVFoundation. It provides all the essentials for working with audiovisual media. Update: Compatible with Swift 2, Swift 3 and Swift 4 as suggested by some of you in the comments. Swift 2.3 Swift 3 Swift 4 (iOS 13 compatible) Make sure to change the name of your tune as well as the extension. The file needs to … Read more