1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- //
- // KMNBaseViewController.swift
- // PDF Reader Pro
- //
- // Created by tangchao on 2023/5/5.
- //
- import Cocoa
- class KMNBaseViewController: NSViewController {
-
- deinit {
- KMPrint(self.className + " deinit.")
-
- self.removeNotifations()
- }
-
- override func viewDidLoad() {
- super.viewDidLoad()
-
- initContentView()
- self.addNotifations()
- }
-
- // Noti
- func addNotifations() {
- updateUIThemeColor()
- NotificationCenter.default.addObserver(self, selector: #selector(updateUIThemeColor), name: APPAppearanceChangedNotificationName, object: nil)
-
- updateUILanguage()
- NotificationCenter.default.addObserver(self, selector: #selector(updateUILanguage), name: APPLanguageChangedNotificationName, object: nil)
- }
-
- func removeNotifations() {
- NotificationCenter.default.removeObserver(self)
- }
-
- @objc func updateUIThemeColor() {}
-
- @objc func updateUILanguage() {}
-
- func initContentView() {}
-
- }
|