# UITableViewDiffableDataSource cannot use struct when Default Actor isolation=Main Actor

**URL:** <https://forums.swift.org/t/uitableviewdiffabledatasource-cannot-use-struct-when-default-actor-isolation-main-actor/84359>\
**Category:** Using Swift\
**Tags:** uikit, mainactor\
**Created:** [January 26, 2026, 7:07am UTC](https://forums.swift.org/t/uitableviewdiffabledatasource-cannot-use-struct-when-default-actor-isolation-main-actor/84359 "2026-01-26T07:07:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xdkhan](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/xdkhan/32/44291_2.png) [@xdkhan](https://forums.swift.org/u/xdkhan)\
**Post date:** [January 26, 2026, 7:07am UTC](https://forums.swift.org/t/uitableviewdiffabledatasource-cannot-use-struct-when-default-actor-isolation-main-actor/84359/1 "2026-01-26T07:07:04Z")

</div>

```swift
import UIKit

struct Song: Hashable, Sendable {
    let id: UUID
    let name: String
}

enum Section: String, Hashable, Sendable {
    case main
}

class ListViewController: UIViewController {
    var dataSource: UITableViewDiffableDataSource<Section, Song>!

    override func viewDidLoad() {
        super.viewDidLoad()
    }
}

```

error tips: Main actor-isolated conformance of 'Song' to 'Hashable' cannot satisfy conformance requirement for a 'Sendable' type parameter 'ItemIdentifierType'

Xcode26.2, Swift 5, Default Actor isolation=Main Actor

if change Default Actor isolation=nonisolated, is fine.

---

<div class="post-metadata">

**Author:** ![anteoi](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/anteoi/32/45644_2.png) [@anteoi](https://forums.swift.org/u/anteoi)\
**Post date:** [January 26, 2026, 8:52am UTC](https://forums.swift.org/t/uitableviewdiffabledatasource-cannot-use-struct-when-default-actor-isolation-main-actor/84359/2 "2026-01-26T08:52:11Z")

</div>

If you specify nonisolated conformance to Hashable then it works:

```swift

struct Song: nonisolated Hashable, Sendable {
    let id: UUID
    let name: String
}

```

---

<div class="post-metadata">

**Author:** ![xdkhan](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/xdkhan/32/44291_2.png) [@xdkhan](https://forums.swift.org/u/xdkhan)\
**Post date:** [January 26, 2026, 10:21am UTC](https://forums.swift.org/t/uitableviewdiffabledatasource-cannot-use-struct-when-default-actor-isolation-main-actor/84359/3 "2026-01-26T10:21:59Z")

</div>

Perfect, thank you for your answer.
