What is Nostr?
David Bureš /
npub1zl9…dnmj
2024-09-01 15:41:09

David Bureš on Nostr: Is there a way to just straight-up force terminate a `.task` in SwiftUI? I'm not ...

Is there a way to just straight-up force terminate a `.task` in SwiftUI? I'm not saying "ask it to please terminate when it's convenient 🥺", I mean "kill yourself right now and throw an error"

I'm running into a problem where I have some resource-intensive tasks that the user might want to kill, completely disregarding their current state. I tried looking it up, and every tutorial I've found is about the former variety. It might not be a best practice, but I swear I have a use case

#swift
Author Public Key
npub1zl99ghn2xqnyffuf3hrgvtj39wuc0jqtz0g8hul4cfzgufxmnd0slddnmj