This repository has been archived by the owner on Jan 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1990820
commit 8481508
Showing
13 changed files
with
743 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>XPCService</key> | ||
<dict> | ||
<key>ServiceType</key> | ||
<string>Application</string> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Foundation | ||
|
||
import ProcessServiceServer | ||
|
||
final class ServiceDelegate: NSObject, NSXPCListenerDelegate { | ||
func listener(_ listener: NSXPCListener, shouldAcceptNewConnection newConnection: NSXPCConnection) -> Bool { | ||
do { | ||
try newConnection.configureProcessServiceServer() | ||
} catch { | ||
return false | ||
} | ||
|
||
newConnection.activate() | ||
|
||
return true | ||
} | ||
} | ||
|
||
let delegate = ServiceDelegate() | ||
let listener = NSXPCListener.service() | ||
|
||
listener.delegate = delegate | ||
listener.resume() | ||
|
Oops, something went wrong.