Bez popisu

AppDelegate.swift 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // AppDelegate.swift
  3. // App for Indeed
  4. //
  5. // Created by Mql Mac 2 on 11/05/2026.
  6. //
  7. import Cocoa
  8. @main
  9. class AppDelegate: NSObject, NSApplicationDelegate {
  10. private let minimumWindowSize = NSSize(width: 1024, height: 700)
  11. func applicationWillFinishLaunching(_ notification: Notification) {
  12. // Dashboard is light-themed; without this, a Dark Mode Mac paints a dark title bar.
  13. NSApp.appearance = NSAppearance(named: .aqua)
  14. }
  15. func applicationDidFinishLaunching(_ aNotification: Notification) {
  16. NSApp.activate(ignoringOtherApps: true)
  17. DispatchQueue.main.async { [weak self] in
  18. guard
  19. let self,
  20. let window = NSApp.windows.first
  21. else { return }
  22. window.minSize = self.minimumWindowSize
  23. window.setContentSize(self.minimumWindowSize)
  24. window.center()
  25. window.makeKeyAndOrderFront(nil)
  26. }
  27. }
  28. func applicationWillTerminate(_ aNotification: Notification) {
  29. // Insert code here to tear down your application
  30. }
  31. func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
  32. return true
  33. }
  34. }