KMNBaseViewController.swift 1023 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // KMNBaseViewController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2023/5/5.
  6. //
  7. import Cocoa
  8. class KMNBaseViewController: NSViewController {
  9. deinit {
  10. KMPrint(self.className + " deinit.")
  11. self.removeNotifations()
  12. }
  13. override func viewDidLoad() {
  14. super.viewDidLoad()
  15. self.addNotifations()
  16. }
  17. // Noti
  18. func addNotifations() {
  19. updateUIThemeColor()
  20. NotificationCenter.default.addObserver(self, selector: #selector(updateUIThemeColor), name: APPAppearanceChangedNotificationName, object: nil)
  21. updateUILanguage()
  22. NotificationCenter.default.addObserver(self, selector: #selector(updateUILanguage), name: APPLanguageChangedNotificationName, object: nil)
  23. }
  24. func removeNotifations() {
  25. NotificationCenter.default.removeObserver(self)
  26. }
  27. @objc func updateUIThemeColor() {}
  28. @objc func updateUILanguage() {}
  29. func initContentView() {}
  30. }