1
0
mirror of https://github.com/davidwernhart/AlDente synced 2025-02-21 06:00:39 +01:00
David Wernhart 906cec6cc5 first commit
2020-02-16 03:28:55 +01:00

26 lines
725 B
Swift

//
// main.swift
// com.davidwernhart.Helper
//
// Created by David Wernhart on 10.02.20.
// Copyright © 2020 David Wernhart. All rights reserved.
//
import Foundation
class HelperDelegate: NSObject, NSXPCListenerDelegate {
func listener(_ listener: NSXPCListener, shouldAcceptNewConnection newConnection: NSXPCConnection) -> Bool {
newConnection.exportedInterface = NSXPCInterface(with: HelperToolProtocol.self)
newConnection.exportedObject = HelperTool()
newConnection.resume()
return true
}
}
let delegate = HelperDelegate()
let listener = NSXPCListener(machServiceName: "com.davidwernhart.Helper.mach")
listener.delegate = delegate
listener.resume()
RunLoop.current.run()