PhonePe Pincode iOS Team Nov 29, 2023

Embracing SwiftUI: PhonePe's Journey Building ONDC-Powered Pincode

Article Summary

PhonePe's iOS team built their entire ONDC shopping app in SwiftUI when most considered it too risky for production. The result? 1M+ downloads and a blueprint for modern iOS development.

The Pincode iOS Team shares their journey building PhonePe's standalone shopping app using SwiftUI instead of UIKit. Launched in April 2023, this was a bold bet on Apple's declarative framework for a greenfield e-commerce product connecting users to local stores via India's ONDC network.

Key Takeaways

Critical Insight

PhonePe proved SwiftUI is production-ready by shipping a complete e-commerce app that hit 1M+ downloads, establishing a path for adopting it in their main 1.2M line codebase.

Their Firebase crash reporting completely broke with SwiftUI, forcing an unexpected workaround that every team should know about.

About This Article

Problem

PhonePe's crash reporting tool couldn't properly symbolicate crashes from SwiftUI, Combine, and Metal Performance Shaders Graph because Apple doesn't provide debug symbols for these frameworks. The team had no way to analyze production issues effectively.

Solution

The Pincode iOS Team built custom modifiers and created a declarative Design System based on SwiftUI's approach. They moved away from their original ViewModel-based design system to cut down on boilerplate code and keep components consistent.

Impact

PhonePe was able to bring developers over from UIKit to SwiftUI's declarative model. The team gained confidence that SwiftUI was ready for production use, and they now have a template for rolling out SwiftUI across their 1.2M line-of-code codebase.