The framework that powers Facebook's Paper content presentation app is being made publicly available to help developers create Apple iOS apps that scroll more smoothly.
The AsyncDisplayKit can be used to build a graphical interface for iPhones and iPads that scrolls and transitions between different views more smoothly than those developed using most standard interface frameworks, said Nadine Salter, a Facebook iOS engineer involved in the project.
AsyncDisplayKit would be particularly useful for building complex applications "where traditional performance optimization approaches have been unable to achieve smooth interactions, or where developers spend a lot of time and effort trying to keep performance in an acceptable range," Salter said via email.
In addition, apps that require gestural interfaces or use physics-based animations would also benefit from the framework, Salter noted.
Ideally, a mobile app interface should be able to achieve a responsiveness of 60 frames per second to enable smooth scrolling, swift response to touch and fluid physics simulations.
Traditional view frameworks for iOS, such as UIKit, can take hundreds of milliseconds to size and display their content, blocking other operations while doing so, which in turn can cause a choppy responsiveness for users. Developers have found ways around the limitation, though mostly through laborious hand-writing of code or by assembling a variety of discrete components.
As its name suggests, AsyncDisplayKit runs asynchronous, or multiple parallel, operations, without blocking other operations on the device, such as scrolling.
The framework was written in Objective-C, but it can be easily used with Apple's new Swift programming language. An experienced iOS engineer should be able to start using the framework within a few hours and within a few days of study could understand the "the full depth of its capabilities," Salter wrote.
AsyncDisplayKit was developed for Paper, a highly tactile iPhone application Facebook released in February for viewing content such as newspaper articles or Facebook feeds. This is not the first piece of Paper that Facebook has open-sourced for others to reuse and modify. In April, Facebook released as open source the Paper Pop animation engine.
Join the CIO New Zealand group on LinkedIn. The group is open to CIOs, IT Directors, COOs, CTOs and senior IT managers.