Tokopedia Arya Surya

Tokopedia: Getting Started with iOS App Modularization: Extracting Catalog

Original post Getting Started with iOS App Modularization: Extracting Catalog

Article Summary

Tokopedia's iOS team tackled a common scaling problem: how do you break apart a monolithic app without creating circular dependency chaos?

This hands-on tutorial from Tokopedia Engineering walks through extracting a Catalog feature into its own framework. It's part 2 of a modularization series that shows the practical steps, not just theory.

Key Takeaways

Critical Insight

A Router abstraction layer lets iOS features navigate between modules without creating circular dependencies or tight coupling.

Continue reading

What This Article Covers

Problem

When Arya Surya's team tried to extract the Catalog framework, they hit a circular dependency problem. Product Detail Page needed to import Catalog, but Catalog also imported Product Detail. This created a dependency loop they couldn't solve.

Solution

Tokopedia Engineering added a Router abstraction pattern to the Shared framework. This let modules navigate to other parts of the app without importing them directly. Instead, route handlers defined in SceneDelegate handled the navigation, keeping the destination frameworks separate from the source modules.

Impact

The modularization approach worked. Catalog and Shared frameworks were successfully extracted into separate Xcode targets. The app kept working, navigation between modules stayed smooth, and there were no tight coupling issues or build failures.

The tutorial includes a GitHub repo with working code at each stage, plus the final part covers building individual frameworks instead of the entire app.

This page summarizes “Getting Started with iOS App Modularization: Extracting Catalog” by Tokopedia, published May 18, 2021. All credit for the original work goes to the authors.

Read the original on medium.com (opens in new tab)

AI tools for iOS

Browse all AI tools →