KMFileManager.swift 516 B

123456789101112131415161718192021222324252627
  1. //
  2. // KMFileManager.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by lizhe on 2024/1/11.
  6. //
  7. import Cocoa
  8. class KMFileManager: NSObject {
  9. static let manager = KMFileManager()
  10. var files: [KMFile] = []
  11. func fetchFile(filePath: String) -> KMFile {
  12. for file in files {
  13. if file.filePath == filePath {
  14. return file
  15. }
  16. }
  17. let file = KMFile()
  18. file.filePath = filePath
  19. self.files.append(file)
  20. return file
  21. }
  22. }