KMBOTAManagerClass.swift 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // KMBOTAManagerClass.swift
  3. // PDF Master
  4. //
  5. // Created by lxy on 2022/11/15.
  6. //
  7. import Cocoa
  8. let thumbnailMethodKey = "KMThumbnailMethodKey"
  9. let outlineMethodKey = "KMOutlineMethoddKey"
  10. let bookMarkMethodKey = "KMBookMarkMethodKey"
  11. let anntationMethodKey = "KMAnntationMethodKey"
  12. let searchMethodKey = "KMSearchMethodKey"
  13. let formMethodKey = "KMFormMethodKey"
  14. let signatureMethodKey = "KMSignatureMethodKey"
  15. class KMBOTAManagerClass: NSObject {
  16. static let shard = KMBOTAManagerClass()
  17. var thumbnailMethod = true
  18. var outlineMethod = true
  19. var bookMarkMethod = true
  20. var anntationMethod = true
  21. var searchMethod = true
  22. var formMethod = false
  23. var signatureMethod = false
  24. private override init() {
  25. super.init()
  26. }
  27. override func copy() -> Any {
  28. return self
  29. }
  30. override func mutableCopy() -> Any {
  31. return self
  32. }
  33. func getMethodShow(key:String) -> Bool {
  34. if UserDefaults.standard.object(forKey:key) != nil {
  35. let value = UserDefaults.standard.bool(forKey: key)
  36. return value
  37. } else {
  38. if key == formMethodKey || key == signatureMethodKey {
  39. return false
  40. }
  41. return true
  42. }
  43. }
  44. func setLeftMethod(show:Bool, key:String) {
  45. UserDefaults.standard.set(show, forKey: key)
  46. UserDefaults.standard.synchronize()
  47. }
  48. }