diff --git a/Modules/Sources/Browse/UI/Components/DocumentPicker.swift b/Modules/Sources/Browse/UI/Components/SelectDocumentPicker.swift similarity index 90% rename from Modules/Sources/Browse/UI/Components/DocumentPicker.swift rename to Modules/Sources/Browse/UI/Components/SelectDocumentPicker.swift index b7b1188..3c1023d 100644 --- a/Modules/Sources/Browse/UI/Components/DocumentPicker.swift +++ b/Modules/Sources/Browse/UI/Components/SelectDocumentPicker.swift @@ -1,5 +1,5 @@ // -// DocumentPicker.swift +// SelectDocumentPicker.swift // Browse // // Created by Javier Cicchelli on 17/12/2022. @@ -10,7 +10,7 @@ import Foundation import SwiftUI import UIKit -struct DocumentPicker: UIViewControllerRepresentable { +struct SelectDocumentPicker: UIViewControllerRepresentable { // MARK: Type aliases @@ -55,20 +55,21 @@ struct DocumentPicker: UIViewControllerRepresentable { func makeCoordinator() -> Coordinator { .init(self) } + } // MARK: - Coordinators -extension DocumentPicker { +extension SelectDocumentPicker { class Coordinator: NSObject, UIDocumentPickerDelegate { // MARK: Properties - private var parent: DocumentPicker + private var parent: SelectDocumentPicker // MARK: Initialisers - init(_ parent: DocumentPicker) { + init(_ parent: SelectDocumentPicker) { self.parent = parent } diff --git a/Modules/Sources/Browse/UI/Views/UploadView.swift b/Modules/Sources/Browse/UI/Views/UploadView.swift index 495a43d..12b33e4 100644 --- a/Modules/Sources/Browse/UI/Views/UploadView.swift +++ b/Modules/Sources/Browse/UI/Views/UploadView.swift @@ -32,7 +32,7 @@ struct UploadView: View { // MARK: Body var body: some View { - DocumentPicker { urls in + SelectDocumentPicker { urls in Task { await addFile(from: urls) } } }