Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Channels ▼


Twitter Releases Open Source UI Framework for Mac

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."

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.