I know, let’s write a streaming web radio application!
Don’t panic; this isn’t as scary as you think. We can get this running with shockingly little code. But let’s do so in a new playground. Close the current playground window, and use File > New > Playground to create a new playground. Call it WebRadioPlayground. Keep the line that says import UIKit, but delete the var str = "Hello, playground" line, and replace it with the following:
|2:||let url = NSURL(string: "http://armitunes.com:8010/listen.pls")|
|3:||let player = AVPlayer(URL: url!)|
Nothing will happen just yet, but hang in there…
The code we’ve ...