KMBatchOperateManager.swift 997 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // KMBatchOperateManager.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by kdanmobile on 2023/11/2.
  6. //
  7. import Foundation
  8. class KMBatchOperateManager: NSObject{
  9. var files: [KMBatchOperateFile]?
  10. var currentType: KMBatchOperationType?{
  11. willSet{
  12. }
  13. didSet {
  14. if currentType != oldValue {
  15. if ((self.files?.isEmpty) != nil){
  16. return
  17. }
  18. for i in 0..<self.files!.count {
  19. let file = self.files![i]
  20. if file.currentOperateType != self.currentType {
  21. file.currentOperateType = self.currentType
  22. }
  23. }
  24. }
  25. }
  26. }
  27. static let defaultManager: KMBatchOperateManager = {
  28. let manager = KMBatchOperateManager()
  29. manager.files = (NSMutableArray() as! [KMBatchOperateFile])
  30. manager.currentType = .Convert
  31. return manager
  32. }()
  33. }