Update: Based on this https://www.swiftbysundell.com/articles/the-main-actor-attribute/#custom-ui-related-classes, I don’t believe with the above solution that the compiler any longer guarantees that cancelled() is called on the main actor (though in practice it will be, because Button will fire its action on the main actor).
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: