title: SWIFT - Can't set MPMediaPicker delegate
body: <p>Code: </p>
  
  <pre><code>import UIKit
  import MediaPlayer 
  
  class WelcomeView: UIViewController {
  
  override func viewDidLoad() {
  super.viewDidLoad()
  var mediaPicker: MPMediaPickerController = MPMediaPickerController.self(mediaTypes:MPMediaType.Music)
  mediaPicker.allowsPickingMultipleItems = false
  mediapicker1 = mediaPicker
  
  }
  
  override func didReceiveMemoryWarning() {
  super.didReceiveMemoryWarning() }
  
  var mediapicker1 = MPMediaPickerController()
  
  @IBAction func selectsong(sender: AnyObject) {
  self.presentViewController(mediapicker1, animated: true, completion: nil)
  }
  }
  </code></pre>
  
  <p>the didPickMediaItems is delegate method/ how can i set the delegate to mediapicker? on the web site it writen simply but i tryed it and it doesnt work in swift. and also, after pick the song how to play it? </p>
  
  <p>i used this websites to create it: 
  <a href="http://midhunmp-iostips.blogspot.com.es/2013/05/showing-songs-list-in-ios-using.html" rel="nofollow">media picker</a>
  and some code from official apple Programming Guide about creating the "hello world" music app) to play music from allsongsquery()</p>