Touching Apple’s Private Multitouch Framework

Ryan Hanson
Ryan Hanson
Published in
2 min readMay 17, 2018

Let’s rewind to MacWorld SF in 2008, the year after Apple introduced the iPhone. Steve Jobs introduces the original MacBook Air that touts a “very generous trackpad” with “Multi-touch” gesture support.

Turns out that the multi-touch trackpad on it was pretty awesome, especially when compared to all other trackpads at the time. Swiping, pinching, and rotating were ported over from the iPhone, and it actually felt natural on these trackpads and on the Mac. Despite Apple not providing much at first for allowing 3rd party developers to interface with multi-touch devices, almost immediately developers were finding ways to grab multi-touch input data and build out apps with custom gestures and more. The earliest example of this is MultiClutch, which came out less than two months after that Steve jobs introduction. The crazy thing is that the 3rd party developers had figured out how to obtain the multi-touch data without Apple’s help, by reverse engineering an interface to the private multi-touch framework in OSX.

There’s definitely some major downsides to using this private framework though. The biggest is that Apple doesn’t guarantee that we will have access to it. This came to a head when Apple decided to disallow public usage of the framework entirely in a macOS 10.13.2 beta build. There must have been enough outcry from people using apps that use the private framework, (BetterTouchTool, JiTouch, and MagicPrefs to name a few) that Apple decided to reverse their decision and again allow the framework to be used. Along those lines, Apple could decide to change the framework in ways that could break any apps that rely on it. With that said, it doesn’t look like it has changed in any breaking ways for the many years that it has been in existence. Furthermore, any app that uses private frameworks cannot be sandboxed and therefore cannot be listed on the macOS App Store.

The reverse-engineered interface to the private framework most assuredly took a lot of sifting through assembly code and trial and error to figure things out. If you’re interested, it’s not hard to find a good bit of resources for reverse engineering on macOS/iOS. Thankfully, we can reap the benefits of what other people have done, and it’s actually pretty straightforward to use the framework and get touch data out of it. Some quick reference examples include ofxTouchPad, FingerMgmt, and Touch/Sesamouse.

You’ll notice that most examples using the private framework are at least a few years old and are not written in Swift. It is possible to interface with the private framework in Swift, though. Feel free to try out what I’ve done with it in my Multitouch app.

--

--