field_ios

In-the-field app for Radroots on iOS
git clone https://radroots.dev/git/field_ios.git
Log | Files | Refs | README | LICENSE

TeraMediaPermissionGuidance.swift (864B)


      1 import SwiftUI
      2 import UIKit
      3 
      4 struct TeraMediaPermissionGuidance: View {
      5   let support: TeraAddMediaSupport
      6   let recheck: @MainActor () async -> Void
      7   @Environment(\.openURL) private var openURL
      8 
      9   var body: some View {
     10     Text(support.cameraAccess.guidance)
     11     Text(support.library
     12       ? "You can select photos from Library without full photo-library access."
     13       : "Photo selection is unavailable.")
     14     Text("You can keep editing and save without adding media.")
     15     if support.cameraAccess == .denied {
     16       Button("Open camera settings") {
     17         if let url = URL(string: UIApplication.openSettingsURLString) {
     18           openURL(url)
     19         }
     20       }
     21       .accessibilityIdentifier("tera.add.camera.settings")
     22     }
     23     Button("Check camera access again") { Task { await recheck() } }
     24       .accessibilityIdentifier("tera.add.camera.recheck")
     25   }
     26 }