Unable to Control Optical Zoom via USB (UVC) in Custom Swift App, While Prebuilt App Works

I’m currently working on a macOS application to control a USB camera’s optical zoom via a direct USB connection.

My situation: I am using a USB camera that supports optical zoom. I downloaded an open-source project, CameraController. The prebuilt binary provided on GitHub works perfectly, and I can successfully control the camera’s optical zoom. However, when I build and run the same project from source in Xcode, the zoom control UI appears disabled (grayed out). The project compiles without errors. Additionally, I attempted to implement zoom control myself using the UVC protocol in Swift . However, it seems that the zoom control commands are not successfully sent or recognized by the camera.

Questions: Why would the prebuilt app work, but the same source code built locally results in disabled zoom controls? Are there known limitations on sending zoom control requests via USB on macOS? Is there a recommended modern approach for controlling optical zoom programmatically via Swift?

Any insights, debugging suggestions, or references would be greatly appreciated. Thanks in advance!

Unable to Control Optical Zoom via USB (UVC) in Custom Swift App, While Prebuilt App Works
 
 
Q