I want to create an alert that redirects the user to Settings App after they denied camera usage for the first time, but the only way that I've seen so far uses UIKit and
let settingsAction = UIAlertAction(title: "Settings", style: .default, handler: {action in
UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!, options: [:], completionHandler: nil)
})
In SwiftUI, there is an actions option within alert, how would I be able to correctly open settings through SwiftUI's version of alert?
.alert(isPresented: $alertVisible) { () -> Alert in Alert (title: Text("Camera access required to take photos"), message: Text("Go to Settings?"),
primaryButton: .default(Text("Settings"), action: UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)),
secondaryButton: .default(Text("Cancel"))