KMCompareWindowController.swift 967 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // KMCompareWindowController.swift
  3. // PDF Master
  4. //
  5. // Created by lizhe on 2023/11/14.
  6. //
  7. import Cocoa
  8. class KMCompareWindowController: KMBaseWindowController {
  9. @IBOutlet weak var compareView: KMCompareView!
  10. var filePath: String = "" {
  11. didSet {
  12. if compareView != nil {
  13. compareView.filePath = filePath
  14. }
  15. }
  16. }
  17. var fileType: KMCompareFilesType = .content {
  18. didSet {
  19. if compareView != nil {
  20. compareView.fileType = fileType
  21. }
  22. }
  23. }
  24. override func windowDidLoad() {
  25. super.windowDidLoad()
  26. // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
  27. compareView.filePath = filePath
  28. compareView.fileType = fileType
  29. compareView.cancelAction = { [unowned self] view in
  30. cancelAction?(self)
  31. }
  32. }
  33. }