// // AppDelegate.swift // PDF Reader Pro Pro // // Created by Niehaoyu on 2022/9/23. // import Cocoa @main class AppDelegate: NSObject, NSApplicationDelegate { func applicationWillFinishLaunching(_ notification: Notification) { ComPDFUIConfig.initializeUIConfig(); } func applicationDidFinishLaunching(_ aNotification: Notification) { // Insert code here to initialize your application } func applicationWillTerminate(_ aNotification: Notification) { // Insert code here to tear down your application } func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { return true } } extension AppDelegate : NSMenuDelegate,NSMenuItemValidation { func validateMenuItem(_ menuItem: NSMenuItem) -> Bool { let action = menuItem.action if action == #selector(manageAcctounMenuAction) { return KMLightMemberManager.manager.isLogin() } if action == #selector(loginMenuItemAction) { return !KMLightMemberManager.manager.isLogin() } return true } }