I\'ve gotten an ActionSheet to present just fine on an iPhone device. But it crashes for iPad. Says it needs the location for the popover. Has anyone had luck with this code? I\
Finally, as tested in iOS 13.4 this has been resolved, at least in the beta. The conflicting constraints warning persists, but the crash is gone. This is now the appropriate way to present an action sheet.
import SwiftUI
struct ContentView : View {
@State var showSheet = false
var body: some View {
VStack {
Button(action: {
self.showSheet.toggle()
}) {
Text("Show")
}
.actionSheet(isPresented: $showSheet, content: { ActionSheet(title: Text("Hello"))
})
}
}
}
struct ContentView_Previews : PreviewProvider {
static var previews: some View {
ContentView()
}
}