title: Spotify API to Swift
body: <p>May be a simple question, but I am trying to use Spotify's API which is documented in Objective C but I have been working on it in Swift as far as I can.</p>
  
  <p><strong>@property (nonatomic, readonly, copy) NSArray *genres</strong>
  is one of their API protocols for the SPTartist class, however; I can't figure out how to use it in a working manner in swift.</p>
  
  <p>Here is example code of something I have gotten to work.</p>
  
  <pre><code>    func updateTrackLength(){
      if player?.currentTrackMetadata == nil {
          trackLength.text = ""
          return
      }
      let length = player?.currentTrackMetadata[SPTAudioStreamingMetadataTrackDuration] as Int
      let convert = length / 60
      let remainder = length % 60
      var newlength = String(convert)
      var newRemainder = String(remainder)
  
  
      dispatch_async(dispatch_get_main_queue(), { () -&gt; Void in
          self.trackLength.text = "Track length: " + newlength + " Minutes " + newRemainder + " Seconds"
      })
  }
  </code></pre>
  
  <p>This uses the currentTrackMetaData and whatever SPT protocol to track the string output. When I try using SPTArtistGenres or SPTArtistGenre in place of SPTAudioStreamingMetaDataTrackDuration, it does not work.
  To specify my question, I want to use the currentTrackMetaData to call the genres property up above. Any advice is greatly appreciated!</p>