DownloadProgressDialog

@MainActor
struct DownloadProgressDialog : View

DownloadProgressDialog A SwiftUI view that displays a progress dialog for downloading model files. This view shows:

  • A title indicating the download status
  • A description of the download process
  • A progress bar showing the current download progress
  • A cancel button to abort the download

Properties

  • Tracks the current download progress (0.0 to 100.0)

    Declaration

    Swift

    @State
    @MainActor
    private var progress: Double { get nonmutating set }
  • Controls the visibility of the dialog

    Declaration

    Swift

    @Binding
    @MainActor
    var isActive: Bool { get nonmutating set }
  • Controls the visibility of error alerts

    Declaration

    Swift

    @Binding
    @MainActor
    var isShowError: Bool { get nonmutating set }
  • Stores the current error type if any occurs

    Declaration

    Swift

    @Binding
    @MainActor
    var error: SDKErrors { get nonmutating set }
  • Callback for when the close button is tapped

    Declaration

    Swift

    @MainActor
    var onTapCloseButton: () -> Void
  • Indicates if the download has completed

    Declaration

    Swift

    @MainActor
    var isCompleted: Bool
  • Information about the face recognition model file to download

    Declaration

    Swift

    @MainActor
    let frModelBin: FileDownloadInfo
  • Flag to stop monitoring download status

    Declaration

    Swift

    @State
    @MainActor
    var isMonitoringStatusToStop: Bool { get nonmutating set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    let filePath: String

View Body

  • Declaration

    Swift

    @MainActor
    var body: some View { get }
  • This function check if the model file exist in the mentioned location if not then it will download the models from the give URL.

    Declaration

    Swift

    @MainActor
    func checkIfTheFileExsist()
  • Function to create folder ‘Model folder’ if it doesn’t exist

    Declaration

    Swift

    @MainActor
    func createFolderIfNeeded()
  • Function to download all the model file

    Declaration

    Swift

    @MainActor
    func downloadFile(fileURL: String)
  • Undocumented

    Declaration

    Swift

    @MainActor
    func updateDownloadProgress()
  • Function to update progress bar and completion state

    Declaration

    Swift

    @MainActor
    func onDownloadComplete()
  • Sets up SDK initialization and handles potential errors.

    Declaration

    Swift

    @MainActor
    func setUpSdkInit()