Under the hood: Rebuilding Facebook for iOS

Visit the post for more.

Jonathan Dann
8 min readbeginner
--
View Original

Overview

The article discusses the comprehensive rebuilding of the Facebook app for iOS, emphasizing improvements in speed, reliability, and user experience. It highlights the transition from the outdated Three20 framework to a native iOS application, leveraging HTML5 and modular design for better performance and scalability.

What You'll Learn

1

How to optimize iOS app performance by offloading tasks from the main thread

2

Why using HTML5 can enhance cross-platform mobile development

3

How to implement a modular architecture in mobile applications

Prerequisites & Requirements

  • Understanding of iOS development principles and performance optimization techniques
  • Familiarity with Xcode and Objective-C

Key Questions Answered

How did Facebook improve the speed of its iOS app?
Facebook improved the speed of its iOS app by offloading computationally expensive tasks to background threads, ensuring that the main thread remains responsive for UI interactions. This includes handling networking, JSON parsing, and layout calculations asynchronously, which significantly enhances user experience.
What is the role of HTML5 in Facebook's mobile strategy?
HTML5 played a crucial role in Facebook's mobile strategy by allowing the company to write code once and deploy it across multiple platforms, including iOS and Android. This approach enabled rapid iteration and feature testing without requiring app updates, thus maintaining a consistent user experience across devices.
What challenges did Facebook face while integrating Messenger into the iOS app?
Facebook faced the challenge of integrating the Messenger app's UI and functionality into the new iOS app while maintaining code compatibility. They achieved this by implementing a modular architecture that allows for dependency injection and shared protocols, ensuring seamless functionality between the two applications.

Key Statistics & Figures

Supported devices
7000
Facebook's mobile experience supports over 500 million users across more than 7000 devices.

Technologies & Tools

Frontend
Html5
Used to build and distribute Facebook mobile experiences across multiple platforms.
Backend
Objective-c
Used for developing the new Facebook for iOS app.
Backend
Core Data
Used for storing story heights and managing data efficiently.
Backend
Mqtt
Used for updating notifications and messages in the app.

Key Actionable Insights

1
Consider offloading heavy computations to background threads to enhance app responsiveness.
This approach is critical in mobile app development, where user experience hinges on smooth interactions. By keeping the main thread free, you can ensure that the app feels fast and responsive.
2
Utilize a modular architecture to improve code maintainability and feature integration.
Implementing modules allows for better organization of code and easier updates, as seen in the integration of Messenger into the Facebook app. This can significantly reduce development time and complexity.

Common Pitfalls

1
Failing to manage background tasks properly can lead to a sluggish app experience.
When heavy tasks are performed on the main thread, it can cause the app to freeze or respond slowly, negatively impacting user experience. Developers should always prioritize offloading such tasks to background threads.

Related Concepts

Mobile App Performance Optimization
Modular Architecture In Software Development
Cross-platform Development Strategies