Spotify API已弃用功能无可奈何

时间:2015-09-01 03:49:45

标签: ios swift spotify libspotify

Spotify已弃用iOS SDK中的部分功能,但未提供替代方案。我在使用Swift中的其中一个函数时遇到了麻烦。是否有在线讨论替代品的文件?不确定它是什么意思"使用完整的元数据对象而不是"。以下是我想要完成的事情:

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
    let playListVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("playlistView") as! PlaylistDetailController

    let partial = self.partialPlaylists[indexPath.row] as! SPTPartialPlaylist
    SPTRequest.requestItemFromPartialObject(partial, withSession: self.session) { (error: NSError!, metadata: AnyObject!) -> Void in
        playListVC.snapshot = partial as! SPTPlaylistSnapshot
        playListVC.currentPage = playListVC.snapshot.firstTrackPage
        playListVC.partialPlaylist = partial
        playListVC.session = self.session
        self.navigationController?.pushViewController(playListVC, animated: true)
    }   
}

如果不使用requestItemFromPartialObject

,任何人都可以想到这样做的方法

1 个答案:

答案 0 :(得分:1)

如果我正确地阅读了这个问题,那么您是否正在寻找一种从部分播放列表中获取完整播放列表的方法?

以下是:

+-----------+------------------+---------------------+---------------------------------+------------------------------------+
| record_id | application_name | date_time           | cpu_usage_per_app_in_percentage | memory_usage_per_app_in_percentage |
+-----------+------------------+---------------------+---------------------------------+------------------------------------+
| 473849    | viber            | 2015-09-06 19:23:13 | 5                               | 2                                  |
| 473850    | watsup           | 2015-09-06 19:23:13 | 9                               | 2                                  |
| 473851    | AccuWeather      | 2015-09-06 19:23:13 | 8                               | 4                                  |
| 473980    | viber            | 2015-09-06 19:23:14 | 4                               | 1                                  |
| 474254    | watsup           | 2015-09-06 19:23:14 | 9                               | 1                                  |
| 474323    | AccuWeather      | 2015-09-06 19:23:14 | 9                               | 2                                  |
| 474533    | viber            | 2015-09-06 19:23:15 | 5                               | 2                                  |
| 474536    | watsup           | 2015-09-06 19:23:15 | 8                               | 3                                  |
| 474537    | AccuWeather      | 2015-09-06 19:23:15 | 5                               | 3                                  |
| 474538    | calendar         | 2015-09-06 19:23:15 | 7                               | 3                                  |
+-----------+------------------+---------------------+---------------------------------+------------------------------------+

基本上,您从部分播放列表中获取uri并使用该URI请求SPTPlaylistSnapshot。返回的“完整元数据对象”是SPTPlaylistSnapshot。