2024-02-05 11:57:52 +03:00
|
|
|
//
|
|
|
|
// FileProviderConfig.swift
|
|
|
|
// FileProviderExt
|
|
|
|
//
|
|
|
|
// Created by Claudio Cambra on 5/2/24.
|
|
|
|
//
|
|
|
|
|
|
|
|
import FileProvider
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
struct FileProviderConfig {
|
|
|
|
enum FileProviderConfigKey: String {
|
|
|
|
case fastEnumerationEnabled = "fastEnumerationEnabled"
|
|
|
|
}
|
|
|
|
|
|
|
|
let domainIdentifier: NSFileProviderDomainIdentifier
|
|
|
|
|
2024-02-05 13:15:45 +03:00
|
|
|
private var internalConfig: [String: Any] {
|
|
|
|
get {
|
|
|
|
let defaults = UserDefaults.standard
|
|
|
|
if let settings = defaults.dictionary(forKey: domainIdentifier.rawValue) {
|
|
|
|
return settings
|
|
|
|
}
|
|
|
|
let dictionary: [String: Any] = [:]
|
|
|
|
defaults.setValue(dictionary, forKey: domainIdentifier.rawValue)
|
|
|
|
return dictionary
|
|
|
|
}
|
|
|
|
set {
|
|
|
|
let defaults = UserDefaults.standard
|
|
|
|
defaults.setValue(newValue, forKey: domainIdentifier.rawValue)
|
|
|
|
}
|
|
|
|
}
|
2024-02-05 11:57:52 +03:00
|
|
|
}
|