SwiftUI 给cell添加点击事件
2020-09-23 本文已影响0人
isnow
List() {
ForEach(landmarkData) { landmark in
LandmarkRow(landmark: landmark).onTapGesture {
self.showingAlert = true
}.alert(isPresented: self.$showingAlert) {
Alert(title: Text(landmark.name),
message: Text(landmark.park),
dismissButton: .default(Text("OK")))
}
}.onDelete(perform: deleteRow)
}