Retrieve list of songs ordered by last play time in iOS

前端 未结 2 587
感情败类
感情败类 2020-12-31 18:57

I need to obtain a list of the N most recently played songs from an iOS device, in order.

The only way I can imagine doing it, at the moment, is by getting

2条回答
  •  失恋的感觉
    2020-12-31 19:53

    I think MPMediaQuery is the only way to get recently played songs from an iOS device at this time.

    You can use property MPMediaItemPropertyLastPlayedDatewhich will return you the most recent calendar date and time on which the user played the media item. Value is an NSDate object.

    http://developer.apple.com/library/IOs/#documentation/MediaPlayer/Reference/MPMediaItem_ClassReference/Reference/Reference.html#//apple_ref/doc/constant_group/General_Media_Item_Property_Keys

提交回复
热议问题