mirror of
https://github.com/AppHouseKitchen/AlDente-Battery_Care_and_Monitoring.git
synced 2026-04-26 10:48:41 +02:00
first commit
This commit is contained in:
25
com.davidwernhart.Helper/main.swift
Normal file
25
com.davidwernhart.Helper/main.swift
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// 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()
|
||||
|
||||
Reference in New Issue
Block a user