0

I save item URL:

var itemUrl: URL? = nil
itemUrl = (qryAlbums.collections[currAlbum].items[currItem].assetURL!)

let tempString: String = (track.last?.value(forKey: “url”) as! String?)!

track.setValue(itemUrl?.absoluteString, forKey: “url”)

now i can play this item with AVPLayer:

AudioPlayerManager.sharedInstance.play(itemUrl)

Q: Now having items url how i can get collection and item index ?

Rhythmic Fistman
  • 34,352
  • 5
  • 87
  • 159
Jay
  • 83
  • 1
  • 1
  • 8
  • How do you know a given url only exists in one collection? – Rhythmic Fistman Oct 11 '16 at 11:23
  • I explain what i need. This is a music player. App saves last played track. On the next launch that track is on start screen. Collection needed for the rewind and forward from the saved track. – Jay Oct 11 '16 at 13:22

0 Answers0