alertview
Sadly, one of the drawbacks that they didn’t fix with SwiftUI 2.0 is the AlertView
, which remains somewhat simplistic. Here’s the template code to create a basic one:
遗憾的是,它们无法使用SwiftUI 2.0修复的缺点之一是AlertView
,它仍然有些简化。 这是创建基本代码的模板代码:
That gives us this:
这给了我们这个:
![Image for post](https://miro.medium.com/freeze/max/9999/1*2LJodZulRiswSQsuxt8oQQ.gif)
However, most alertView
s need to do more than warn you that the app has done something — they need more buttons. Now, even in SwiftUI 1.0 you can a