erikberglund / SwiftPrivilegedHelper

Example application using a privileged helper tool with authentication in an unsandboxed application written in Swift
MIT License
180 stars 33 forks source link

Enhancement suggestions #14

Open paya-cz opened 5 years ago

paya-cz commented 5 years ago

I am going over the sample code for sandboxing/XPC by Apple and I prefer how they dealt with keeping connection references when needing to call back into the app from the helper tool. Instead of having a single Helper class that keeps an array of connections (which always leads to a question - which array element should I use to report progress), they instead create an object per connection, and bind the connection to each object, see here: https://developer.apple.com/library/archive/samplecode/SandboxingAndNSXPCConnection/Listings/fetch_service_main_m.html#//apple_ref/doc/uid/DTS40012665-fetch_service_main_m-DontLinkElementID_9