Twitter has taken formal steps to offer TwUI as an open-source framework for developing interfaces on the Mac. To define it more specifically, TwUI is a hardware-accelerated user interface (UI) framework for Apple Mac.
According to the github social coding website, "TwUI should be considered an alpha project. It is currently shipping in Twitter for Mac, in use 24/7 by many, many users and has proven itself very stable. The code still has a few Twitter-for-Mac-isms that should be refactored and cleaned up."
The release of TwUI to the software development community addresses the fact that (according to Twitter) until now, there was not a simple and effective way to design interactive, hardware-accelerated interfaces on the Mac.
"Core Animation can create hardware-accelerated drawings, but doesn't provide interaction mechanisms. AppKit and NSView have excellent interaction mechanisms, but the drawings operations are CPU-bound, which makes fluid scrolling, animations, (and other effects) difficult — if not impossible — to accomplish," said Twitter, in a press statement.
Twitter says that TwUI brings the philosophy of the already available UIKit to the desktop. It is built on top of Core Animation, and it borrows interaction ideas from AppKit. It allows for all the things Mac users expect, including drag-and-drop, mouse events, tooltips, and Mac-like text selection.
The special sauce here may well be the fact that since TwUI isn't bound by the constraints of an existing API, developers can experiment with new features like block-based drawRect and layout.
How TwUI works:
- You will recognize the fundamentals of TwUI if you are familiar with UIKit. For example, a "TUIView" is a simple, lightweight wrapper around a Core Animation layer — much like UIView on iOS.
- UIView offers useful subclasses for operations such as scroll views, table views, buttons, and so on.
- TwUI makes it easy to build your own custom interface components.
- Because all of these views are backed by layers, composited by Core Animation, your UI is rendered at optimal speed.
"Since TwUI forms the basis of Twitter for the Mac, it is an integral part of our shipping code," says Twitter. "Going forward, we need to stress test it in several implementations. We'll continue to develop additional features and make improvements. We encourage you to experiment, as that will help us build a robust and exciting UI framework for the Mac."


