aboutsummaryrefslogblamecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/Application.swift
blob: 9f7b81055c69ad1b489ac750c1bf56226c1539cf (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                                  
// SPDX-License-Identifier: MIT
// Copyright © 2018 WireGuard LLC. All Rights Reserved.

import Cocoa

var appDelegate: AppDelegate?

class Application: NSApplication {
    // We use a custom Application class to be able to set the app delegate
    // before app.run() gets called in NSApplicationMain().
    override class var shared: NSApplication {
        let app = NSApplication.shared
        appDelegate = AppDelegate() // Keep a strong reference to the app delegate
        app.delegate = appDelegate
        return app
    }
}