I've been following this tutorial. This line of code returns nil...
let url = NSBundle.mainBundle().URLForResource(filename as String, withExtension: "caf")
Here's my resources...
Here's my build phase...
NSBundle(forClass: self.dynamicType)
doesn't improve the situation.
The code worked when I dragged the sound file into the project instead of into the project's asset catalogue. I'm guessing that the latter's items are referenced by id instead of file name and type.
I also needed to add the sound file to the "Copy Bundle Resources" section in "Build Phases".