Renamed the DocumentPicker component as SelectDocumentPicker for the Browse module.
This commit is contained in:
parent
b0bba71288
commit
7d737cb12b
@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// DocumentPicker.swift
|
// SelectDocumentPicker.swift
|
||||||
// Browse
|
// Browse
|
||||||
//
|
//
|
||||||
// Created by Javier Cicchelli on 17/12/2022.
|
// Created by Javier Cicchelli on 17/12/2022.
|
||||||
@ -10,7 +10,7 @@ import Foundation
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
struct DocumentPicker: UIViewControllerRepresentable {
|
struct SelectDocumentPicker: UIViewControllerRepresentable {
|
||||||
|
|
||||||
// MARK: Type aliases
|
// MARK: Type aliases
|
||||||
|
|
||||||
@ -55,20 +55,21 @@ struct DocumentPicker: UIViewControllerRepresentable {
|
|||||||
func makeCoordinator() -> Coordinator {
|
func makeCoordinator() -> Coordinator {
|
||||||
.init(self)
|
.init(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Coordinators
|
// MARK: - Coordinators
|
||||||
|
|
||||||
extension DocumentPicker {
|
extension SelectDocumentPicker {
|
||||||
class Coordinator: NSObject, UIDocumentPickerDelegate {
|
class Coordinator: NSObject, UIDocumentPickerDelegate {
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
private var parent: DocumentPicker
|
private var parent: SelectDocumentPicker
|
||||||
|
|
||||||
// MARK: Initialisers
|
// MARK: Initialisers
|
||||||
|
|
||||||
init(_ parent: DocumentPicker) {
|
init(_ parent: SelectDocumentPicker) {
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
}
|
}
|
||||||
|
|
@ -32,7 +32,7 @@ struct UploadView: View {
|
|||||||
// MARK: Body
|
// MARK: Body
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
DocumentPicker { urls in
|
SelectDocumentPicker { urls in
|
||||||
Task { await addFile(from: urls) }
|
Task { await addFile(from: urls) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user