Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #read #music #library #iphone #programmatically #swift
ADD COMMENT
Topic
Name
5+6 =