16 lines
360 B
Swift
16 lines
360 B
Swift
import Foundation
|
|
|
|
public enum FileDirectory: Sendable, Hashable {
|
|
case documents, caches, custom(URL)
|
|
public func url() -> URL {
|
|
switch self {
|
|
case .documents:
|
|
return URL.documentsDirectory
|
|
case .caches:
|
|
return URL.cachesDirectory
|
|
case .custom(let url):
|
|
return url
|
|
}
|
|
}
|
|
}
|