title: DiffableDataSource throws "Fatal: supplied identifiers are not unique." when wrapping MPMediaItem inside a struct
body: <p>I used <code>UITableviewDiffableDataSource</code> with <code>UITableView</code> to display songs from the music library. This code worked fine:</p>
  
  <pre class="lang-swift prettyprint-override"><code>let tracks: [MPMediaItem] = MPMediaQuery.songs().items ?? []
  self.dataSource.apply(section: 0, items: tracks)
  </code></pre>
  
  <p>But when I wrapped <code>MPMediaItem</code> inside a custom <code>Track struct</code>, I got this error: <code>Fatal: supplied identifiers are not unique.</code></p>
  
  <pre class="lang-swift prettyprint-override"><code>struct Track: Equatable, Hashable {
    let item: MPMediaItem
  
    var title: String? { item.title }
  
    init(item: MPMediaItem) {
      self.item = item
    }
  }
  let items = MPMediaQuery.songs().items ?? []
  let tracks: [Track] = items.map { Track(item: $0) }
  self.dataSource.apply(section: 0, items: tracks)
  
  </code></pre>
  
  <p><code>MPMediaItem</code> has already conformed <code>Equatable</code> and <code>Hashable</code> so I think it should be fine if I use it in another struct which also conforms <code>Equatable</code> and <code>Hashable</code> (<code>Track struct</code>).</p>
  
  <p>Update 1: <code>apply(section:items:)</code> is an extension I added to <code>UITableViewDiffableDataSource</code> for convenient:</p>
  
  <pre class="lang-swift prettyprint-override"><code>extension UITableViewDiffableDataSource {
    func apply(section: SectionIdentifierType, items: [ItemIdentifierType], animatingDifferences: Bool = false) {
      var snapshot = NSDiffableDataSourceSnapshot&lt;SectionIdentifierType, ItemIdentifierType&gt;()
      snapshot.appendSections([section])
      snapshot.appendItems(items)
      apply(snapshot, animatingDifferences: animatingDifferences)
    }
  }
  </code></pre>
  
  <p>Update 2: It worked after I conformed <code>Track</code> to <code>Identifiable</code> protocol:</p>
  
  <pre class="lang-swift prettyprint-override"><code>struct Track: Equatable, Hashable, Identifiable {
    let item: MPMediaItem
  
    let id: MPMediaEntityPersistentID
  
    var title: String? { item.title }
  
    init(item: MPMediaItem) {
      self.item = item
      self.id = item.persistentID
    }
  }
  </code></pre>
  
  <p>or even changed <code>title</code> to store property also worked without any errors:</p>
  
  <pre class="lang-swift prettyprint-override"><code>struct Track: Equatable, Hashable {
    let item: MPMediaItem
  
    let title: String?
  
    init(item: MPMediaItem) {
      self.item = item
      self.title = item.title
    }
  }
  </code></pre>
  
  <p>What makes it so different between these cases? And why do I got the error when using <code>MPMediaItem</code> as the only store property of the <code>Track</code> struct? Thanks in advance!</p>