As users download new songs into their iPod Music library from the iTunes Store, I would like to programmatically list those songs in a table view. Is it possible to obtain the "Date Added" or "Purchase Date" from the MPMediaItemCollection? I see there are property keys such as play count and last played date. I know the data exists because it can be viewed in iTunes, but I am not finding it. Any suggestions on where to find this or how to derive it?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
As you can see in Apple Documentation for MPMediaItem http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPMediaItem_ClassReference/Reference/Reference.html#//apple_ref/occ/cl/MPMediaItem, you access all the properties through
enumerateValuesForProperties:usingBlock:
orvalueForProperty:
, but there isn't a property for Date Added or Purchased Date informations.This doesn't mean that the data isn't stored somewhere (surely it is): this just means that you cannot access that information through public APIs, maybe for privacy issues.
I don't know anyway if there is a way to obtain this information through some private API calls, but if it exists you can't use it for AppStore apps because it will cause you a rejection during review process.
As of iOS 10 it appears we have access to two dateAdded properties.
Note: iOS 10 is still in beta (4) at time of writing so things could change.
As a Date object:
and as a String:
source: https://developer.apple.com/library/prerelease/content/releasenotes/General/iOS10APIDiffs/Objective-C/MediaPlayer.html