Objective-C Makes Facebook for iOS Likable

| News

Facebook Objective-CLast week, Facebook debuted version 5.0 of its mobile app for iOS. The new app promised much faster performance, and a look behind the scenes finds that Facebook was able to achieve these performance gains by dropping HTML 5 and embracing Apple’s Objective-C in developing the app.

Slow

The app, which accounts for an increasingly large percentage of the company’s overall traffic (543 million monthly users as of June 30), has had a storied past since its inception in 2008. While performance has never fully emulated the browser experience, last fall’s 4.0 reworking introduced an entire slew of new bugs and unsavory slowdown along with highly anticipated native support for iPad. 

Over the course of the past year, the app’s performance degraded further, and it has been surpassed in terms of design and functionality by other official offerings from social players such as Twitter, Instagram and Google. Thankfully, version 5.0 promises—and seemingly delivers—up to twice the performance of the app’s previous iterations, along with a subtle reinterpretation of the user interface. 

So why did the update take so long? Surely Facebook, the company who pioneered the modern era of social networking, would have the resources to devote to developing a properly functioning app. As it turns out, the app’s previous shortcomings were rooted in the language it was written in, HTML5. 

Up until last Thursday, Facebook for iOS was primarily comprised of HTML5 and built on the Three20 framework Facebook developed in the early days of the App Store. As the store evolved, and with the advent of additional iOS devices, the Three20 platform began to break down, and HTML5 emerged as an insufficient “catch-all” solution for the app’s back end.

Originally intended to provide a scalable, unified and up-to-date experience across iOS, Android and other mobile devices, Facebook’s HTML5 underbelly made its iOS app feel sluggish and broken as more and more developers shifted to the iOS native Objective-C language for their apps, while Facebook continued to update its own platform.

Fast

Facebook realized its quandary, and in June two of the company’s engineers disclosed to The New York Times that a new, substantially faster app was in the development pipeline for release in July. Though the app turned out to be released in August instead, it makes good on its speed claims thanks to an Objective-C rewrite and several additional behind the scenes enhancements.

In an official Facebook note published last week, Engineer Jonathan Dann went into greater detail on what was involved in the 5.0 release. Mr. Dann reported that by re-balancing the app’s structure and moving CPU intensive tasks away from the app’s main thread, the company was able to achieve some subtle speed boosts.

Additionally, the app now displays previously cached data upon startup, meaning faster launch times and less time spent staring at the iconic (and dreaded) gray spinner. These modifications all serve to improve usability, load times and stability on the base level of the app.

Modular

In addition to shifting the app’s core to Objective-C, the Facebook development team parlayed much of the code from its standalone Facebook Messenger—an earlier, message specific Objective-C app. Using Facebook Messenger as a base, the team developed a system of modules within the app.

In his post, Mr. Dann noted that these new modules specify their dependencies and are used to update messages, bookmarks and notifications. To avoid future slowdowns, the modular system checks to make sure application setup happens correctly as new features are added.

Failure to adapt to the continuous rollout of enhancements and new features was a major issue plaguing earlier releases of the app. Jonathan Dann and his team worked around this by developing a “fallback” renderer for the latest version of Facebook mobile.

When a new type of news feed story or post is introduced that the app doesn’t understand, the aforementioned renderer is called into play to translate. The information from the story is then rendered and displayed in a format the app already understands—alleviating many of the display quirks and rendering issues prominent in the HTML5 based version.

While the new app is almost exclusively Objective-C based, the team will continue to use HTML5 in places to update the app server side, eliminating the need to push incessant updates to iOS users through the App Store.

The future of Facebook (and social networking) is becoming increasingly mobile, and having a solid, speedy and functional app is a key requirement if the company intends to grow its mobile presence further. As Mr. Dann put it:

Building on native iOS gives us a major opportunity to keep making the app faster, more reliable and feature-rich. Whether you have 30 seconds or an entire train ride to use Facebook we want you to have a fast and satisfying experience. We truly believe mobile is the best platform for Facebook, and the new Facebook for iOS is just one of our steps to ensure you have best Facebook experience anytime, anywhere.

So far, it appears the engineering and development teams have hit their mark, as version 5.0 is a sizable improvement. If you’ve avoided Facebook for iOS in the past, it may be time to reconsider—version 5.0 is definitely worth a like.

Sign Up for the Newsletter

Join the TMO Express Daily Newsletter to get the latest Mac headlines in your e-mail every weekday.

1 Comments

Lee Dronick

Speed isn’t everything, much of it looks horrid. They may be able to fix the look of it, hopefully soon,

Log-in to comment