ViewController.swift 1020 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // ViewController.swift
  3. // google_apps
  4. //
  5. // Created by Dev Mac 1 on 27/03/2026.
  6. //
  7. import Cocoa
  8. import SwiftUI
  9. class ViewController: NSViewController {
  10. private var hostingView: NSHostingView<LauncherRootView>?
  11. override func viewDidLoad() {
  12. super.viewDidLoad()
  13. let launcher = LauncherRootView()
  14. let hostingView = NSHostingView(rootView: launcher)
  15. hostingView.translatesAutoresizingMaskIntoConstraints = false
  16. view.addSubview(hostingView)
  17. NSLayoutConstraint.activate([
  18. hostingView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
  19. hostingView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
  20. hostingView.topAnchor.constraint(equalTo: view.topAnchor),
  21. hostingView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
  22. ])
  23. self.hostingView = hostingView
  24. }
  25. override var representedObject: Any? {
  26. didSet {
  27. // Intentionally left blank.
  28. }
  29. }
  30. }