VIPER Architecture on iOS at Etsy
Article Summary
Michael MacDougall from Etsy reveals how they tackled iOS architecture chaos with VIPER. The overhead was brutal, but the consistency payoff changed everything.
Etsy's iOS team was struggling with inconsistent development patterns that made jumping between projects difficult. They adopted VIPER architecture despite its steep learning curve, then built VIPERBuilder to solve the boilerplate problem.
Key Takeaways
- VIPER splits view controllers into 5 distinct objects: View, Interactor, Presenter, Entity, Router
- Etsy built VIPERBuilder to automate class connections and eliminate tedious boilerplate
- Team shipped major features with it: shop stats, multi-shop checkout, search, seller dashboard
- Main tradeoff: significant overhead and retain cycle risks versus architectural consistency
Etsy standardized iOS development with VIPER, then created VIPERBuilder to make the architecture practical at scale across multiple production features.
About This Article
Etsy's iOS developers struggled with VIPER's learning curve and architectural complexity. The pattern required many class references, and weak references had to be handled carefully to avoid retain cycles.
Michael MacDougall's team built VIPERBuilder, a framework that uses Swift generics to automatically wire together Interactor, Presenter, and Router base classes. This eliminated the tedious boilerplate code developers had to write by hand.
Etsy shipped four major production features using VIPER and VIPERBuilder: shop stats, multi-shop checkout, search, and the seller dashboard. The approach scaled across their iOS team.