📌  相关文章
📜  如何在 swift 代码示例中以编程方式从 iphone 读取音乐库

📅  最后修改于: 2022-03-11 15:01:02.434000             🧑  作者: Mango

代码示例1
// All
let mediaItems = MPMediaQuery.songsQuery().items
// Or you can filter on various property
// Like the Genre for example here
var query = MPMediaQuery.songsQuery()
let predicateByGenre = MPMediaPropertyPredicate(value: "Rock", forProperty: MPMediaItemPropertyGenre)
query.filterPredicates = NSSet(object: predicateByGenre)