BlaBlaCar Michael Caylus Dec 6, 2017

Building a Reusable Component Library on iOS

Article Summary

Michael Caylus from BlaBlaCar reveals how his iOS team built a component library that cut development time and unified their UI across 117 screens. The secret? Treating UI components like Lego bricks.

After designers introduced Atomic Design principles, BlaBlaCar's iOS team spent three months building a Swift component library. The framework separates each component into three distinct concerns: Data, Style, and Layout. This architectural decision became the foundation for faster development and consistent user experiences.

Key Takeaways

Critical Insight

BlaBlaCar reduced boilerplate code and improved UI consistency by architecting reusable components around separated data, style, and layout concerns.

The team's approach to theming and style guides solved a problem most component libraries struggle with as they scale.

About This Article

Problem

BlaBlaCar's iOS team found it hard to read code when they wrote frame computations by hand. Even with support libraries in place, teammates struggled to understand the layout logic.

Solution

They switched to the Framing library, which made the syntax for frame computation much simpler. The layout code became easier to read and maintain across the codebase.

Impact

The clearer code helped new team members get up to speed faster and reduced bugs when refactoring layouts. Later, the team realized that fixed frame computation was probably premature optimization compared to what hybrid approaches could offer.