Integrating Extensions into Large-Scale iOS apps
Article Summary
Lyft's iOS team built an Apple Maps extension that lets users book rides without leaving Maps. But the initial version added 45MB to their app—nearly a quarter of Apple's 200MB cellular download limit.
Lyft engineers Artur Stepaniuk and Max Husar share how they integrated ride booking into Apple Maps while managing a highly modular iOS codebase built with Bazel. The challenge: reducing memory footprint and binary size without sacrificing functionality.
Key Takeaways
- Reduced extension binary size from 45MB to 15MB through dependency optimization
- Used Bazel queries and Gephi visualization to map hundreds of module dependencies
- Removed CoreUI module (15MB) by creating lightweight service alternatives
- Extensions have 20-50MB RAM limits and strict API restrictions to manage
- Third-party dependencies with APPLICATION_EXTENSION_API_ONLY flag caused linking issues
By systematically analyzing their dependency graph and stripping unnecessary modules, Lyft cut their Apple Maps extension size by 67% while maintaining full booking functionality.
About This Article
Lyft's extension used 21MB of runtime memory, pushing against the 20-50MB limit. The initial binary size hit 45MB, which was nearly a quarter of Apple's 200MB cellular download threshold. This risked making users hesitant to install it.
Lyft engineers used Bazel dependency queries and Gephi visualization to map out what was taking up space. The UI module consumed 15MB, the networking layer used 7MB, IDL imports took 6MB, and the Maps/ML stack added 8MB. Instead of extracting a shared core submodule, they built a lightweight separate service module just for ride offers.
The extension binary shrank from 45MB to 15MB, a 67% reduction. The team kept all booking functionality intact while staying comfortably within Apple's download and memory limits for app extensions.