From 7d737cb12bd7364319c09d7cc1a79276f461c52d Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sun, 18 Dec 2022 00:58:29 +0100 Subject: [PATCH] Renamed the DocumentPicker component as SelectDocumentPicker for the Browse module. --- ...ocumentPicker.swift => SelectDocumentPicker.swift} | 11 ++++++----- Modules/Sources/Browse/UI/Views/UploadView.swift | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) rename Modules/Sources/Browse/UI/Components/{DocumentPicker.swift => SelectDocumentPicker.swift} (90%) 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) } } }