Renamed the DocumentPicker component as SelectDocumentPicker for the Browse module.

This commit is contained in:
Javier Cicchelli 2022-12-18 00:58:29 +01:00
parent b0bba71288
commit 7d737cb12b
2 changed files with 7 additions and 6 deletions

View File

@ -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
}

View File

@ -32,7 +32,7 @@ struct UploadView: View {
// MARK: Body
var body: some View {
DocumentPicker { urls in
SelectDocumentPicker { urls in
Task { await addFile(from: urls) }
}
}