Answers for "ios swift add to music library"

0

how to read music library from iphone programmatically in swift

// 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)
Posted by: Guest on June-15-2020

Code answers related to "Swift"

Browse Popular Code Answers by Language