12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- //
- // KMCropManager.swift
- // PDF Reader Pro
- //
- // Created by Niehaoyu on 2024/11/22.
- //
- import Cocoa
- class KMCropManager: NSObject {
-
- static let defaultManager = KMCropManager()
-
- var cropRect: CGRect? = nil
-
- var cropSeparateOn: Bool = false {
- didSet {
- UserDefaults.setDefaultBoolValue(cropSeparateOn, toKey: "CropSeparateOnKey")
- }
- }
-
- var cropAutoOn: Bool = false {
- didSet {
- UserDefaults.standard.setValue(cropAutoOn, forKey: "CropAutoOnKey")
- }
- }
-
- override init() {
- super.init()
-
- self.initData()
-
- }
-
- func initData() {
- self.cropSeparateOn = UserDefaults.getDefaultBoolValue(forKey: "CropSeparateOnKey")
-
- self.cropAutoOn = UserDefaults.getDefaultBoolValue(forKey: "CropAutoOnKey")
- }
-
- func clear() {
- cropRect = nil
-
- }
-
- }
|