AppDelegate.swift 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // AppDelegate.swift
  3. // PDF Reader Pro DMG
  4. //
  5. // Created by Niehaoyu on 2022/9/23.
  6. //
  7. import Cocoa
  8. @main
  9. class AppDelegate: NSObject, NSApplicationDelegate {
  10. func applicationWillFinishLaunching(_ notification: Notification) {
  11. ComPDFUIConfig.initializeUIConfig();
  12. }
  13. func applicationDidFinishLaunching(_ aNotification: Notification) {
  14. KMNThumbnailManager.clearCacheThumImage() //清除页面缩图缓存
  15. // Insert code here to initialize your application
  16. // MARK: 广告数据初始化
  17. KMAdvertisementManager.manager.initConfig(appName: .PDFReaderProMac,
  18. subscribeType: .unsubscribed,
  19. platform: .Mac)
  20. // 测试模式,默认false
  21. KMAdvertisementManager.manager.debug = true
  22. }
  23. func applicationWillTerminate(_ aNotification: Notification) {
  24. // Insert code here to tear down your application
  25. }
  26. func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
  27. return true
  28. }
  29. }
  30. extension AppDelegate : NSMenuDelegate,NSMenuItemValidation {
  31. func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
  32. let action = menuItem.action
  33. return true
  34. }
  35. }