Any source code samples for how to program DockKit ?
I have read https://developer.apple.com/documentation/DockKit and would like to see it used in an app. For instance, how to setup notification in a SwiftUI-based app running code like this
do {
for await accessory in try DockAccessoryManager.shared.accessoryStateChanges {
// If this is an accessory you’re interested in, save it for later use.
}
} catch {
log(“Failed fetching state changes, \(error)“)
}
In this video, it seems possible to retrieve dock accessory state changes and control the motors after stopping system tracking (06:39),
Sure, that's possible. "Stopping system tracking" basically means "stop moving the dock on your own", at which point you could manually move the dock. This is covered in "Modify rotation and positioning programmatically".
However...
so perhaps I need to obtain a reference to the dock from AVCapture as you indicated.
...the more "interesting" parts of DockKit are how it interacts with the camera and image recognition. The APIs for that kind of control exist at many different "levels" of the API, with the right choice really depending on what you actually need/want.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware