mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +00:00
26 lines
715 B
Swift
26 lines
715 B
Swift
//
|
|
// FileManager+DocumentsOpener.swift
|
|
// QuickDrop
|
|
//
|
|
// Created by Leon Böttger on 10.11.25.
|
|
//
|
|
|
|
import Foundation
|
|
import UIKit
|
|
import LUI
|
|
|
|
extension FileManager {
|
|
public func openDocumentFolder() {
|
|
#if !EXTENSION
|
|
let documentsUrl = self.urls(for: .documentDirectory, in: .userDomainMask).first
|
|
|
|
if let documentsUrl = documentsUrl, let sharedUrl = URL(string: "shareddocuments://\(documentsUrl.path)"), UIApplication.shared.canOpenURL(sharedUrl) {
|
|
UIApplication.shared.open(sharedUrl, options: [:])
|
|
}
|
|
else {
|
|
showAlert(title: "CouldNotOpenDocumentsFolder", message: "CouldNotOpenDocumentsFolderDescription")
|
|
}
|
|
#endif
|
|
}
|
|
}
|