mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-09-15 17:00:57 +00:00
19 lines
592 B
Swift
19 lines
592 B
Swift
import Foundation
|
|
import Brief
|
|
|
|
class ServiceDelegate: NSObject, NSXPCListenerDelegate {
|
|
|
|
func listener(_ listener: NSXPCListener, shouldAcceptNewConnection newConnection: NSXPCConnection) -> Bool {
|
|
newConnection.exportedInterface = NSXPCInterface(with: (any ReleasesDownloaderProtocol).self)
|
|
let exportedObject = ReleasesDownloader()
|
|
newConnection.exportedObject = exportedObject
|
|
newConnection.resume()
|
|
return true
|
|
}
|
|
}
|
|
|
|
let delegate = ServiceDelegate()
|
|
let listener = NSXPCListener.service()
|
|
listener.delegate = delegate
|
|
listener.resume()
|