My MPMediaplayer is working pretty well for Music, but when I start working with Podcasts things are different.
I'm trying to get two things: 1) The name the Podcast Title ("This American Life") 2) The Episode Title ("My Holiday")
This line of code works fine to get the Podcast Title:
let podTitle:String = (myMP.nowPlayingItem?.podcastTitle)!
However this line should get the Episode Title:
let episode:String = myMP.nowPlayingItem?.value(forProperty: "MPMediaItemPropertyTitle") as! String
but causes a crash with this error:
fatal error: unexpectedly found nil while unwrapping an Optional value
How can I get the Episode Title for a given Podcast?