A Mac app with an iPhone as a controller

Hello! I'm trying to develop a Mac app with an iPhone as a controller. In specific, I need the Mac app to stream the iPhone's sensor data with low latency. How do I approach this, please? What features should I use to implement this? Where can I find some currently available resources for me to get started? Thank you.

Update: I have just realised that I can do the calculation on the iOS app, and only send trigger messages to the Mac app. Does this make it easier? If so, the only requirement now is to achieve a latency as low as possible, and not higher than 0.1 seconds.

Sending this notification via the network seems like a reasonable option in that case. A good place to start would be the Building a custom peer-to-peer protocol sample code.

Regarding network latency in general, I have a long post that covers that: Investigating Network Latency Problems. One thing to watch out for is peer-to-peer Wi-Fi. If your Mac and iPhone are on the same infrastructure Wi-Fi, it’s best not to set includePeerToPeer.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thank you for your reply, Quinn! In case you didn't see my comment above, here I post it again.

I downloaded the Tic-Tac-Toe project, and tried the steps from your latency article, but the latency is still unstable, ranging from something very low to a higher end of roughly 0.3-0.5 seconds, which would be too high for my purpose. Is it because the communication here is message-based, and happens at a certain interval, rather than continuously? Could this get better if I make use of a stream? If so, how can I do it, please?

Also, could Bonjour have been causing the delay? I've tried following the intro video of the Network framework, but I got stuck because I don't know what to put as my "host" and "port". Would you like to recommend some resources for me to get familiar with these stuff?

I look forward to hearing from you. Thank you.

A Mac app with an iPhone as a controller
 
 
Q