How to implement UITextPasteDelegate so Swift Concurrency is happy?

I have a UITextView subclass that implements UITextPasteDelegate so it can customize copying and pasting formatted text, both from other apps and between instances of itself in a custom internal data format. It looks like this:

class MyTextView : UITextView {
    //...
}

extension MyTextView : UITextPasteDelegate {
    func textPasteConfigurationSupporting(_ textPasteConfigurationSupporting: any UITextPasteConfigurationSupporting, transform item: any UITextPasteItem) {
        let internalCopyType = "myType"
        if item.itemProvider.hasItemConformingToTypeIdentifier(internalCopyType) {
            item.itemProvider.loadDataRepresentation(forTypeIdentifier: internalCopyType) { dta, err in
                if let dta {
                    item.setResult(attributedString: NSAttributedString())
                }
            }
        }
    }
}

On item.setResult(...), I get these warnings:

Call to main actor-isolated instance method 'setResult(attributedString:)' in a synchronous nonisolated context; this is an error in Swift 6

Capture of 'item' with non-sendable type 'any UITextPasteItem' in a @Sendable closure

The warnings honestly make some sense - UITextPasteItem is crossing a thread boundary, and setResult has to be called from the main thread. But it also seems like I'm using this API exactly as intended.

If I put the call to setResult on the main actor, I still get the second warning:

item.itemProvider.loadDataRepresentation(forTypeIdentifier: internalCopyType) { dta, err in
    Task {
        await MainActor.run {
            if let dta {
                item.setResult(attributedString: NSAttributedString())
            }
        }
    }
}

What's the best way to approach this? Is this another problem that will be solved by transferring parameters, like in Concurrency warning from async network call returning parsed json dictionary in actor method?