You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
598 B
Swift
23 lines
598 B
Swift
import Foundation
|
|
import UIKit
|
|
|
|
@MainActor
|
|
extension NodeAppModel {
|
|
func permissionSnapshot() -> IOSPermissionSnapshot {
|
|
IOSPermissionCenter.statusSnapshot()
|
|
}
|
|
|
|
@discardableResult
|
|
func requestPermission(_ permission: IOSPermissionKind) async -> IOSPermissionSnapshot {
|
|
_ = await IOSPermissionCenter.request(permission)
|
|
return IOSPermissionCenter.statusSnapshot()
|
|
}
|
|
|
|
func openSystemSettings() {
|
|
guard let url = URL(string: UIApplication.openSettingsURLString) else {
|
|
return
|
|
}
|
|
UIApplication.shared.open(url)
|
|
}
|
|
}
|