KMBOTAManagerClass.swift 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // KMBOTAManagerClass.swift
  3. // PDF Reader Pro
  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. let snapshotMethodKey = "KMSnapshotMethodKey"
  16. class KMBOTAManagerClass: NSObject {
  17. static let shard = KMBOTAManagerClass()
  18. var thumbnailMethod = true
  19. var outlineMethod = true
  20. var bookMarkMethod = true
  21. var anntationMethod = true
  22. var searchMethod = true
  23. var formMethod = false
  24. var signatureMethod = false
  25. private override init() {
  26. super.init()
  27. }
  28. override func copy() -> Any {
  29. return self
  30. }
  31. override func mutableCopy() -> Any {
  32. return self
  33. }
  34. func getMethodShow(key:String) -> Bool {
  35. if UserDefaults.standard.object(forKey:key) != nil {
  36. let value = UserDefaults.standard.bool(forKey: key)
  37. return value
  38. } else {
  39. if key == formMethodKey || key == signatureMethodKey {
  40. return false
  41. }
  42. return true
  43. }
  44. }
  45. func setLeftMethod(show:Bool, key:String) {
  46. UserDefaults.standard.set(show, forKey: key)
  47. UserDefaults.standard.synchronize()
  48. }
  49. }