UIKit Best Practices and Tips
Article Summary
Bohdan Orlov from Bumble challenges a core assumption in iOS development: what if fighting UIKit is the real problem? His team's approach cuts boilerplate while keeping code maintainable.
This article from Bumble's engineering team presents a pragmatic alternative to heavy architectural patterns like VIPER. Instead of abstracting away UIKit with layers of code, Orlov demonstrates how to work with the framework's built-in capabilities to achieve clean architecture with less overhead.
Key Takeaways
- ViewControllers as kings: retain ViewModels instead of the reverse to prevent dangling references
- ViewControllerLifecycleBehaviour protocol hooks into lifecycle without manual forwarding
- Responder chain navigation eliminates transient dependencies deep in view hierarchies
- Entity-Component-System pattern for analytics: decorate UIViews, scan visible hierarchy automatically
Critical Insight
Embracing UIKit's design rather than fighting it produces simpler, more maintainable code with fewer architectural layers to support.