This works with Swift 1, but reports error in Swift 2:
let image:UIImage = UIImage(named: getStringForLanguage(french: "lock_en", english: "lock_fr.") as! String)!
let albumArt = MPMediaItemArtwork(image: image)
let songInfo: NSMutableDictionary = [
MPMediaItemPropertyTitle: "",
MPMediaItemPropertyArtist: "",
MPMediaItemPropertyArtwork: albumArt
]
MPNowPlayingInfoCenter.defaultCenter().nowPlayingInfo = songInfo // this reports the error
Error message:
Cannot assign a value of type 'NSMutableDictionary' to a value of type '[String : AnyObject]?'