异步按钮 (AsyncButton)

这是一个方便的类型,用于将异步逻辑封装在 SwiftUI 的 Button 中。 此代码的最初基础取自 John Sundell 的文章:https://swiftbysundell.com/articles/building-an-async-swiftui-button/。 这包括 AsyncButton 的主要思想和结构。 我以各种方式对其进行了重新构建(即使用 OptionSet 作为 ActionOptions,向后移植到 iOS 13,使用 .task 修饰符而不是嵌套的 Task,额外的便利初始化器等)。

待办事项 (To-Do's)