You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
LeCountdown/LeCountdown/Views/Components/PermissionAlertView.swift

31 lines
650 B

//
// PermissionAlertView.swift
// LeCountdown
//
// Created by Laurent Morvillier on 02/02/2023.
//
import SwiftUI
struct PermissionAlertView: View {
var body: some View {
Button("Show permissions") {
self._showPermissionSettings()
}
Button("OK", role: .cancel) { }
}
fileprivate func _showPermissionSettings() {
if let url = URL(string: UIApplication.openNotificationSettingsURLString) {
UIApplication.shared.open(url)
}
}
}
struct PermissionAlertView_Previews: PreviewProvider {
static var previews: some View {
PermissionAlertView()
}
}