Say I want to sync a toggle in my app with SMAppService's .status property.
If the status changes from my app I can track it. But if user toggles it from System Settings, I don't see a notification so then the UI in my app is out of date.
The status property is not key value observable and there doesn't appear to be a SMAppServiceStatusDidChangeNotification ?
I can re-read it every time my app will become active but feels kind of wrong to do it this way.
I believe your analysis is essentially correct. My advice is that you file an enhancement request for some sort of notification API.
Please post your bug number, just for the record.
I can re-read it every time my app will become active
One other option is to monitor the state of the resulting launchd
job. However, polling the SMAppService.status
property is going to be a lot easier and will handle more cases.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"